提交 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 @@
*.iws
*.iml
*.ipr
*.gitignore
/nbproject/private/
/build/
......@@ -73,4 +75,5 @@ crashlytics-build.properties
fabric.properties
LOG_PATH_IS_UNDEFINED/
/LOG_PATH_IS_UNDEFINED/
\ No newline at end of file
/LOG_PATH_IS_UNDEFINED/
*tomcat-log/*
......@@ -11,7 +11,7 @@
<groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-client</artifactId>
<version>1.0.3.4</version>
<version>1.0.3.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.3</version>
<version>1.0.1.4</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
......
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.req.AcctPatPageReq;
import com.pica.cloud.account.account.common.req.InitAcctReq;
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.PatBindResp;
import com.pica.cloud.account.account.common.resp.PatFamilyResp;
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 org.springframework.web.bind.annotation.*;
import java.util.List;
......@@ -43,6 +38,9 @@ public interface PatHealthPackClient {
@GetMapping(value = "/account/pat-health/familyAcct/patId/{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")
PicaResponse initAccts(@RequestBody List<InitAcctReq> initAcctReqList);
......
......@@ -11,7 +11,7 @@
<groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-common</artifactId>
<version>1.0.1.3</version>
<version>1.0.1.4</version>
<name>pica-cloud-account-common</name>
<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 @@
<dependency>
<groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-common</artifactId>
<version>1.0.1.3</version>
<version>1.0.1.4</version>
</dependency>
<dependency>
......
......@@ -224,7 +224,7 @@ public class AccountController extends AccountBaseController {
this.checkMobilePhone(request.getMobile());
//接入新旭事务一致性
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();
req.setMobilePhone(request.getMobile());
// 登录或注册,只能使用验证码
......@@ -237,19 +237,35 @@ public class AccountController extends AccountBaseController {
Account account = accountService.getByMobilePhone(req.getMobilePhone());
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) {
LoginResult result = new LoginResult();
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 response;
} else {
// 注册
PicaResponse<LoginResult> result = this.register(req);
intactUtil.sendIntact(batchNo,"loginRegister",com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3,"注册成功,返回值:"+ JSON.toJSONString(result));
PicaResponse<LoginResult> result = null;
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;
}
}
......
// Copyright 2016-2101 Pica.
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.AcctPatInfoReq;
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.req.*;
import com.pica.cloud.account.account.common.resp.AcctPatIdResp;
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.PatHealthPackService;
......@@ -81,6 +79,11 @@ public class PatHealthPackController {
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("初始主账户数据")
@PostMapping(value = "/init/accts")
......
......@@ -64,6 +64,7 @@ public enum AccountExceptionEnum {
PAT_MOBILE_BINDED_WECHAT_ERROR("216555","该手机已绑定其他微信"),
PAT_MEMBER_HAS_BINDED_SELF("216556","该成员已被账户绑定为家庭成员,不需要再次绑定"),
PAT_HAS_CREATE_ACCT("216557","初始居民已存在主账户"),
PAT_QUERY_MAX("216558","查询参数过多"),
xxx_xxx("","");
......
......@@ -22,15 +22,22 @@ public interface AcctPatFamilyMapper {
/** 获取居民id是本人的家庭组记录- 作为家庭主账户、本人居民id,单条ok 多条异常数据 */
AcctPatFamily getByPatIdSelf(Integer patId);
/** list查询 波子1000条调用 */
List<AcctPatFamily> getListByPatIdSelfs(List<Integer> list);
/** 查询居民id所在家庭组监护人- 作为家庭成员、非主账户本人居民id,单条ok 多条异常数据 */
AcctPatFamily getByPatIdNotSelf(Integer patId);
List<AcctPatFamily> getListByPatIdNotSelfs(List<Integer> list);
/** 获取主账户下所有家庭成员 */
List<AcctPatFamily> getListByAcctId(Integer acctId);
/** 根据账户id 获取主账户居民 */
AcctPatFamily getSelfByAcctId(Integer acctId);
List<AcctPatFamily> getSelfListByAcctIds(List<Integer> list);
List<AcctPatFamily> getListByPatIds(List<Integer> patIds);
List<AcctPatFamily> getByPatIdSelfList(List<Integer> patIds);
......
// Copyright 2016-2101 Pica.
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.AcctPatInfoReq;
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.req.*;
import com.pica.cloud.account.account.common.resp.AcctPatIdResp;
import com.pica.cloud.account.account.common.resp.PatBindResp;
import com.pica.cloud.account.account.common.resp.PatFamilyResp;
......@@ -36,6 +34,8 @@ public interface PatHealthPackService {
Integer getFamilyAcctPatId(Integer patId);
AcctPatIdResp getFamilyAcctPatIds(AcctPatIdReq acctPatIdReq);
Integer initAccts(List<InitAcctReq> list);
List<Integer> queryByPage(AcctPatPageReq patPageReq);
......
......@@ -395,6 +395,7 @@ public class LoginServiceImpl implements LoginService {
map.put("openid", weChatEntity.getOpenid());
Map weChatUserInfo = WeChatUtils.getWeChatUserInfo(map, weChatURL);
WeChatUserInfoEntity weChatUserInfoEntity = WeChatUtils.mergeWechatUserInfo(weChatUserInfo, weChatEntity.getOpenid());
logger.info("loginByWeChat: 获取微信用户信息:{}",JSONObject.toJSONString(weChatUserInfoEntity));
String unionId = weChatUserInfoEntity.getUnionid();
AccountUnionEntity accountUnionEntity = accountUnionMapper.selectByUnionId(unionId);
//是否绑定逻辑的判断
......
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.Doctor;
import com.pica.cloud.account.account.server.enums.SourceTypeEnum;
......@@ -98,6 +99,7 @@ public class TokenUtils {
* @return
*/
public String generateToken(Account account) {
logger.info("generateToken account:{}",JSONObject.toJSONString(account));
Integer registerSource = account.getRegisterSource();
String newToken = "";
try {
......
......@@ -156,6 +156,18 @@
and delete_flag = 1;
</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
<include refid="Base_Column_List" />
......@@ -165,6 +177,18 @@
and delete_flag = 1;
</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
<include refid="Base_Column_List" />
......@@ -174,6 +198,18 @@
and delete_flag = 1;
</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
<include refid="Base_Column_List" />
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册