提交 1e63c7ce 编写于 作者:  Peijun.zhao's avatar Peijun.zhao

Merge branch 'yizhixing-0616' into 'release'

Yizhixing 0616

reviewCode赵培军

See merge request !31
流水线 #26801 已失败 于阶段
in 0 second
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
*.iws *.iws
*.iml *.iml
*.ipr *.ipr
*.gitignore
/nbproject/private/ /nbproject/private/
/build/ /build/
...@@ -74,3 +76,4 @@ fabric.properties ...@@ -74,3 +76,4 @@ fabric.properties
LOG_PATH_IS_UNDEFINED/ LOG_PATH_IS_UNDEFINED/
/LOG_PATH_IS_UNDEFINED/ /LOG_PATH_IS_UNDEFINED/
*tomcat-log/*
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<groupId>com.pica.cloud.account</groupId> <groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-client</artifactId> <artifactId>pica-cloud-account-client</artifactId>
<version>1.0.3.4</version> <version>1.0.3.5</version>
<name>pica-cloud-account-client</name> <name>pica-cloud-account-client</name>
<packaging>jar</packaging> <packaging>jar</packaging>
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<dependency> <dependency>
<groupId>com.pica.cloud.account</groupId> <groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-common</artifactId> <artifactId>pica-cloud-account-common</artifactId>
<version>1.0.1.3</version> <version>1.0.1.4</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
......
package com.pica.cloud.account.account.client; package com.pica.cloud.account.account.client;
import com.pica.cloud.account.account.common.req.AcctPatFamilyReq; import com.pica.cloud.account.account.common.req.*;
import com.pica.cloud.account.account.common.req.AcctPatInfoReq; import com.pica.cloud.account.account.common.resp.AcctPatIdResp;
import com.pica.cloud.account.account.common.req.AcctPatPageReq;
import com.pica.cloud.account.account.common.req.InitAcctReq;
import com.pica.cloud.account.account.common.resp.PatBindResp; 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.PatFamilyResp;
import com.pica.cloud.foundation.entity.PicaResponse; import com.pica.cloud.foundation.entity.PicaResponse;
import org.springframework.cloud.netflix.feign.FeignClient; import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
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; import java.util.List;
...@@ -43,6 +38,9 @@ public interface PatHealthPackClient { ...@@ -43,6 +38,9 @@ public interface PatHealthPackClient {
@GetMapping(value = "/account/pat-health/familyAcct/patId/{patId}") @GetMapping(value = "/account/pat-health/familyAcct/patId/{patId}")
PicaResponse<Integer> getFamilyAcctPatId(@PathVariable("patId") Integer patId); PicaResponse<Integer> getFamilyAcctPatId(@PathVariable("patId") Integer patId);
@PostMapping(value = "/account/pat-health/familyAcct/patIds")
PicaResponse<AcctPatIdResp> getFamilyAcctPatIds(@RequestBody AcctPatIdReq acctPatIdReq);
@PostMapping(value = "/account/pat-health/init/accts") @PostMapping(value = "/account/pat-health/init/accts")
PicaResponse initAccts(@RequestBody List<InitAcctReq> initAcctReqList); PicaResponse initAccts(@RequestBody List<InitAcctReq> initAcctReqList);
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<groupId>com.pica.cloud.account</groupId> <groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-common</artifactId> <artifactId>pica-cloud-account-common</artifactId>
<version>1.0.1.3</version> <version>1.0.1.4</version>
<name>pica-cloud-account-common</name> <name>pica-cloud-account-common</name>
<packaging>jar</packaging> <packaging>jar</packaging>
......
package com.pica.cloud.account.account.common.req;
import java.util.List;
public class AcctPatIdReq {
private List<Integer> patIds;
public List<Integer> getPatIds() {
return patIds;
}
public void setPatIds(List<Integer> patIds) {
this.patIds = patIds;
}
}
package com.pica.cloud.account.account.common.resp;
public class AcctPatId {
private Integer reqPatId;
private Integer acctPatId;
public Integer getReqPatId() {
return reqPatId;
}
public void setReqPatId(Integer reqPatId) {
this.reqPatId = reqPatId;
}
public Integer getAcctPatId() {
return acctPatId;
}
public void setAcctPatId(Integer acctPatId) {
this.acctPatId = acctPatId;
}
}
package com.pica.cloud.account.account.common.resp;
import io.swagger.annotations.ApiModel;
import java.util.Map;
/**
*
*/
@ApiModel(description = "建立微信与账号关联关系-resp")
public class AcctPatIdResp {
private Map<Integer, Integer> patFamId;
public Map<Integer, Integer> getPatFamId() {
return patFamId;
}
public void setPatFamId(Map<Integer, Integer> patFamId) {
this.patFamId = patFamId;
}
}
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
<dependency> <dependency>
<groupId>com.pica.cloud.account</groupId> <groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-common</artifactId> <artifactId>pica-cloud-account-common</artifactId>
<version>1.0.1.3</version> <version>1.0.1.4</version>
</dependency> </dependency>
<dependency> <dependency>
......
...@@ -224,7 +224,7 @@ public class AccountController extends AccountBaseController { ...@@ -224,7 +224,7 @@ public class AccountController extends AccountBaseController {
this.checkMobilePhone(request.getMobile()); this.checkMobilePhone(request.getMobile());
//接入新旭事务一致性 //接入新旭事务一致性
String batchNo = IntactUtils.getUUID(); String batchNo = IntactUtils.getUUID();
intactUtil.sendIntact(batchNo,"loginRegister",com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_1,"entity:"+ JSON.toJSONString(entity)); intactUtil.sendIntact(batchNo,"h5-loginRegister",com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_1,"entity:"+ JSON.toJSONString(entity));
AccountReq req = new AccountReq(); AccountReq req = new AccountReq();
req.setMobilePhone(request.getMobile()); req.setMobilePhone(request.getMobile());
// 登录或注册,只能使用验证码 // 登录或注册,只能使用验证码
...@@ -237,19 +237,35 @@ public class AccountController extends AccountBaseController { ...@@ -237,19 +237,35 @@ public class AccountController extends AccountBaseController {
Account account = accountService.getByMobilePhone(req.getMobilePhone()); Account account = accountService.getByMobilePhone(req.getMobilePhone());
if (account != null) { if (account != null) {
// 登录 // 登录
PicaResponse response = this.login(req); PicaResponse response = null;
try {
response = this.login(req);
} catch (PicaException e) {
if(e.getCode().equals(PicaResultCode.PARAM_IS_INVALID.code()) || e.getCode().equals(PicaResultCode.RESULE_DATA_NONE.code())){
intactUtil.sendIntact(batchNo,"h5-loginRegister",com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3,"验证码错误或过期-不加入提醒,返回值:"+ JSON.toJSONString(response));
}
throw e;
}
if (response.getData() != null) { if (response.getData() != null) {
LoginResult result = new LoginResult(); LoginResult result = new LoginResult();
result.setToken(response.getData().toString()); result.setToken(response.getData().toString());
intactUtil.sendIntact(batchNo,"loginRegister",com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3,"登录成功,返回值:"+ JSON.toJSONString(response.getData())); intactUtil.sendIntact(batchNo,"h5-loginRegister",com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3,"登录成功,返回值:"+ JSON.toJSONString(response.getData()));
return PicaResponse.toResponse(result); return PicaResponse.toResponse(result);
} }
return response; return response;
} else { } else {
// 注册 // 注册
PicaResponse<LoginResult> result = this.register(req); PicaResponse<LoginResult> result = null;
intactUtil.sendIntact(batchNo,"loginRegister",com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3,"注册成功,返回值:"+ JSON.toJSONString(result)); try {
result = this.register(req);
} catch (PicaException e) {
if(e.getCode().equals(PicaResultCode.PARAM_IS_INVALID.code()) || e.getCode().equals(PicaResultCode.RESULE_DATA_NONE.code())){
intactUtil.sendIntact(batchNo,"h5-loginRegister",com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3,"验证码错误或过期-不加入提醒,返回值:"+ JSON.toJSONString(result));
}
throw e;
}
intactUtil.sendIntact(batchNo,"h5-loginRegister",com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3,"注册成功,返回值:"+ JSON.toJSONString(result));
return result; return result;
} }
} }
......
// Copyright 2016-2101 Pica. // Copyright 2016-2101 Pica.
package com.pica.cloud.account.account.server.controller; package com.pica.cloud.account.account.server.controller;
import com.pica.cloud.account.account.common.req.AcctPatFamilyReq; import com.pica.cloud.account.account.common.req.*;
import com.pica.cloud.account.account.common.req.AcctPatInfoReq; import com.pica.cloud.account.account.common.resp.AcctPatIdResp;
import com.pica.cloud.account.account.common.req.AcctPatPageReq;
import com.pica.cloud.account.account.common.req.InitAcctReq;
import com.pica.cloud.account.account.common.resp.PatBindResp; 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.PatFamilyResp;
import com.pica.cloud.account.account.server.service.PatHealthPackService; import com.pica.cloud.account.account.server.service.PatHealthPackService;
...@@ -81,6 +79,11 @@ public class PatHealthPackController { ...@@ -81,6 +79,11 @@ public class PatHealthPackController {
return PicaResponse.toResponse(packService.getFamilyAcctPatId(patId)); return PicaResponse.toResponse(packService.getFamilyAcctPatId(patId));
} }
@ApiOperation("根据patientIds 获取监护人-本人监护人(自身patId),本人成员(监护人patId)")
@PostMapping(value = "/familyAcct/patIds")
public PicaResponse<AcctPatIdResp> getFamilyAcctPatIds(@RequestBody AcctPatIdReq acctPatIdReq) throws Exception {
return PicaResponse.toResponse(packService.getFamilyAcctPatIds(acctPatIdReq));
}
@ApiOperation("初始主账户数据") @ApiOperation("初始主账户数据")
@PostMapping(value = "/init/accts") @PostMapping(value = "/init/accts")
......
...@@ -64,6 +64,7 @@ public enum AccountExceptionEnum { ...@@ -64,6 +64,7 @@ public enum AccountExceptionEnum {
PAT_MOBILE_BINDED_WECHAT_ERROR("216555","该手机已绑定其他微信"), PAT_MOBILE_BINDED_WECHAT_ERROR("216555","该手机已绑定其他微信"),
PAT_MEMBER_HAS_BINDED_SELF("216556","该成员已被账户绑定为家庭成员,不需要再次绑定"), PAT_MEMBER_HAS_BINDED_SELF("216556","该成员已被账户绑定为家庭成员,不需要再次绑定"),
PAT_HAS_CREATE_ACCT("216557","初始居民已存在主账户"), PAT_HAS_CREATE_ACCT("216557","初始居民已存在主账户"),
PAT_QUERY_MAX("216558","查询参数过多"),
xxx_xxx("",""); xxx_xxx("","");
......
...@@ -22,15 +22,22 @@ public interface AcctPatFamilyMapper { ...@@ -22,15 +22,22 @@ public interface AcctPatFamilyMapper {
/** 获取居民id是本人的家庭组记录- 作为家庭主账户、本人居民id,单条ok 多条异常数据 */ /** 获取居民id是本人的家庭组记录- 作为家庭主账户、本人居民id,单条ok 多条异常数据 */
AcctPatFamily getByPatIdSelf(Integer patId); AcctPatFamily getByPatIdSelf(Integer patId);
/** list查询 波子1000条调用 */
List<AcctPatFamily> getListByPatIdSelfs(List<Integer> list);
/** 查询居民id所在家庭组监护人- 作为家庭成员、非主账户本人居民id,单条ok 多条异常数据 */ /** 查询居民id所在家庭组监护人- 作为家庭成员、非主账户本人居民id,单条ok 多条异常数据 */
AcctPatFamily getByPatIdNotSelf(Integer patId); AcctPatFamily getByPatIdNotSelf(Integer patId);
List<AcctPatFamily> getListByPatIdNotSelfs(List<Integer> list);
/** 获取主账户下所有家庭成员 */ /** 获取主账户下所有家庭成员 */
List<AcctPatFamily> getListByAcctId(Integer acctId); List<AcctPatFamily> getListByAcctId(Integer acctId);
/** 根据账户id 获取主账户居民 */ /** 根据账户id 获取主账户居民 */
AcctPatFamily getSelfByAcctId(Integer acctId); AcctPatFamily getSelfByAcctId(Integer acctId);
List<AcctPatFamily> getSelfListByAcctIds(List<Integer> list);
List<AcctPatFamily> getListByPatIds(List<Integer> patIds); List<AcctPatFamily> getListByPatIds(List<Integer> patIds);
List<AcctPatFamily> getByPatIdSelfList(List<Integer> patIds); List<AcctPatFamily> getByPatIdSelfList(List<Integer> patIds);
......
// Copyright 2016-2101 Pica. // Copyright 2016-2101 Pica.
package com.pica.cloud.account.account.server.service; package com.pica.cloud.account.account.server.service;
import com.pica.cloud.account.account.common.req.AcctPatFamilyReq; import com.pica.cloud.account.account.common.req.*;
import com.pica.cloud.account.account.common.req.AcctPatInfoReq; import com.pica.cloud.account.account.common.resp.AcctPatIdResp;
import com.pica.cloud.account.account.common.req.AcctPatPageReq;
import com.pica.cloud.account.account.common.req.InitAcctReq;
import com.pica.cloud.account.account.common.resp.PatBindResp; 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.PatFamilyResp;
...@@ -36,6 +34,8 @@ public interface PatHealthPackService { ...@@ -36,6 +34,8 @@ public interface PatHealthPackService {
Integer getFamilyAcctPatId(Integer patId); Integer getFamilyAcctPatId(Integer patId);
AcctPatIdResp getFamilyAcctPatIds(AcctPatIdReq acctPatIdReq);
Integer initAccts(List<InitAcctReq> list); Integer initAccts(List<InitAcctReq> list);
List<Integer> queryByPage(AcctPatPageReq patPageReq); List<Integer> queryByPage(AcctPatPageReq patPageReq);
......
...@@ -395,6 +395,7 @@ public class LoginServiceImpl implements LoginService { ...@@ -395,6 +395,7 @@ public class LoginServiceImpl implements LoginService {
map.put("openid", weChatEntity.getOpenid()); map.put("openid", weChatEntity.getOpenid());
Map weChatUserInfo = WeChatUtils.getWeChatUserInfo(map, weChatURL); Map weChatUserInfo = WeChatUtils.getWeChatUserInfo(map, weChatURL);
WeChatUserInfoEntity weChatUserInfoEntity = WeChatUtils.mergeWechatUserInfo(weChatUserInfo, weChatEntity.getOpenid()); WeChatUserInfoEntity weChatUserInfoEntity = WeChatUtils.mergeWechatUserInfo(weChatUserInfo, weChatEntity.getOpenid());
logger.info("loginByWeChat: 获取微信用户信息:{}",JSONObject.toJSONString(weChatUserInfoEntity));
String unionId = weChatUserInfoEntity.getUnionid(); String unionId = weChatUserInfoEntity.getUnionid();
AccountUnionEntity accountUnionEntity = accountUnionMapper.selectByUnionId(unionId); AccountUnionEntity accountUnionEntity = accountUnionMapper.selectByUnionId(unionId);
//是否绑定逻辑的判断 //是否绑定逻辑的判断
......
package com.pica.cloud.account.account.server.util; package com.pica.cloud.account.account.server.util;
import com.alibaba.fastjson.JSONObject;
import com.pica.cloud.account.account.server.entity.Account; import com.pica.cloud.account.account.server.entity.Account;
import com.pica.cloud.account.account.server.entity.Doctor; import com.pica.cloud.account.account.server.entity.Doctor;
import com.pica.cloud.account.account.server.enums.SourceTypeEnum; import com.pica.cloud.account.account.server.enums.SourceTypeEnum;
...@@ -98,6 +99,7 @@ public class TokenUtils { ...@@ -98,6 +99,7 @@ public class TokenUtils {
* @return * @return
*/ */
public String generateToken(Account account) { public String generateToken(Account account) {
logger.info("generateToken account:{}",JSONObject.toJSONString(account));
Integer registerSource = account.getRegisterSource(); Integer registerSource = account.getRegisterSource();
String newToken = ""; String newToken = "";
try { try {
......
...@@ -156,6 +156,18 @@ ...@@ -156,6 +156,18 @@
and delete_flag = 1; and delete_flag = 1;
</select> </select>
<select id="getSelfListByAcctIds" parameterType="java.util.List" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from account_pat_family
where acct_id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
and relation = 1
and delete_flag = 1;
</select>
<select id="getByPatIdSelf" parameterType="java.lang.Integer" resultMap="BaseResultMap" > <select id="getByPatIdSelf" parameterType="java.lang.Integer" resultMap="BaseResultMap" >
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
...@@ -165,6 +177,18 @@ ...@@ -165,6 +177,18 @@
and delete_flag = 1; and delete_flag = 1;
</select> </select>
<select id="getListByPatIdSelfs" 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 relation = 1
and delete_flag = 1;
</select>
<select id="getByPatIdNotSelf" parameterType="java.lang.Integer" resultMap="BaseResultMap" > <select id="getByPatIdNotSelf" parameterType="java.lang.Integer" resultMap="BaseResultMap" >
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
...@@ -174,6 +198,18 @@ ...@@ -174,6 +198,18 @@
and delete_flag = 1; and delete_flag = 1;
</select> </select>
<select id="getListByPatIdNotSelfs" 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 relation != 1
and delete_flag = 1;
</select>
<select id="getListByPatIds" parameterType="java.util.List" resultMap="BaseResultMap" > <select id="getListByPatIds" parameterType="java.util.List" resultMap="BaseResultMap" >
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册