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

Merge branch 'dev-follow-0630' into 'release'

Dev follow 0630

See merge request !115
流水线 #48159 已取消 于阶段
......@@ -11,7 +11,7 @@
<groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-client</artifactId>
<version>1.1.2.1-SNAPSHOT</version>
<version>1.1.3</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.1.2.1-SNAPSHOT</version>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
......
package com.pica.cloud.account.account.client;
import com.pica.cloud.account.account.common.req.*;
import com.pica.cloud.account.account.common.req.EncryptEntity;
import com.pica.cloud.account.account.common.req.HospitalSaasUserReq;
import com.pica.cloud.account.account.common.req.LoginResult;
......@@ -32,6 +33,9 @@ public interface RegisterClient {
@PostMapping(value = "/account/circle/acct")
PicaResponse<List<Integer>> register(@RequestBody CircleAcctInitReq circleAcctInitReq, @RequestHeader(value = "token") String token);
@PostMapping(value = "/account/circle/acct/followup")
PicaResponse<List<DocInfoResp>> registerFollowup(@RequestBody List<DocInfoReq> req, @RequestHeader(value = "token") String token);
@PostMapping(value = "/account/shop/acct")
PicaResponse<Map<String,Integer>> shopRegister(@RequestBody ShopAcctInitReq shopAcctInitReq, @RequestHeader(value = "token") String token);
......
......@@ -11,7 +11,7 @@
<groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-common</artifactId>
<version>1.1.2.1-SNAPSHOT</version>
<version>1.1.3</version>
<name>pica-cloud-account-common</name>
<packaging>jar</packaging>
......@@ -30,18 +30,11 @@
</dependency>
</dependencies>
<!--<distributionManagement>
<repository>
<id>nexus</id>
<name>Pica 3rdParty Repository</name>
&lt;!&ndash; <url>http://192.168.141.133:8082/repository/pica-3rdParty/</url>&ndash;&gt;
<url>http://nexus.picahealth.com:8082/repository/pica-3rdParty/</url>
</repository>
</distributionManagement>-->
<distributionManagement>
<repository>
<id>nexus</id>
<name>Pica 3rdParty Repository</name>
<!-- <url>http://192.168.141.133:8082/repository/pica-3rdParty/</url>-->
<url>http://nexus.picahealth.com:8082/repository/pica-3rdParty/</url>
</repository>
<snapshotRepository>
......
package com.pica.cloud.account.account.common.req;
/**
* User: Joy
* Description:
* Date: 2022-06-17 15:26
*/
public class DocInfoReq {
private String name;
// 手机明文
private String mobile;
private String seq;
// 1 安卓 2 ios 3 web 4 h5 5 admin
private Integer source;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getSeq() {
return seq;
}
public void setSeq(String seq) {
this.seq = seq;
}
public Integer getSource() {
return source;
}
public void setSource(Integer source) {
this.source = source;
}
}
package com.pica.cloud.account.account.common.req;
/**
* User: Joy
* Description:
* Date: 2022-06-17 15:27
*/
public class DocInfoResp {
private String seq;
private Integer doctorId;
public String getSeq() {
return seq;
}
public void setSeq(String seq) {
this.seq = seq;
}
public Integer getDoctorId() {
return doctorId;
}
public void setDoctorId(Integer doctorId) {
this.doctorId = doctorId;
}
}
......@@ -167,7 +167,7 @@
<dependency>
<groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-common</artifactId>
<version>1.1.2</version>
<version>1.1.3</version>
</dependency>
<dependency>
......
package com.pica.cloud.account.account.server.controller;
import com.pica.cloud.account.account.common.req.DocInfoReq;
import com.pica.cloud.account.account.common.req.DocInfoResp;
import com.pica.cloud.account.account.common.req.circle.CircleAcctInitReq;
import com.pica.cloud.account.account.common.req.circle.DiyAcctInitReq;
import com.pica.cloud.account.account.server.service.CircleAccountService;
......@@ -36,6 +38,12 @@ public class CircleUserController {
return PicaResponse.toResponse(circleAccountService.createCircleAccount(circleAcctInitReq));
}
@PostMapping("/acct/followup")
@EnabledLoginValidate
public PicaResponse<List<DocInfoResp>> followupUserInit(@RequestBody List<DocInfoReq> req) {
return PicaResponse.toResponse(circleAccountService.createFollowupAccount(req));
}
@PostMapping("/acct/decryMobile")
@EnabledLoginValidate
public PicaResponse<List<Integer>> circleUserInitDecryMobile(@RequestBody DiyAcctInitReq diyAcctInitReq) {
......
package com.pica.cloud.account.account.server.service;
import com.pica.cloud.account.account.common.req.DocInfoReq;
import com.pica.cloud.account.account.common.req.DocInfoResp;
import com.pica.cloud.account.account.common.req.circle.CircleAcctInitReq;
import com.pica.cloud.account.account.common.req.shop.ShopAcctInitReq;
import com.pica.cloud.account.account.common.req.circle.DiyAcctInitReq;
......@@ -19,6 +21,9 @@ public interface CircleAccountService {
//创建圈子入口-用户账号
List<Integer> createCircleAccount(CircleAcctInitReq circleAcctInitReq);
//随访入口-创建用户账号
List<DocInfoResp> createFollowupAccount(List<DocInfoReq> initAccoutsReq);
//批量创建用户- 手机号,姓名
List<Integer> createDiyAccount(DiyAcctInitReq diyAcctInitReq);
......
......@@ -90,6 +90,7 @@ public class AccountServiceImpl implements AccountService {
AccountInfoEntity accountInfo = new AccountInfoEntity();
Date currentTime = new Date();
accountInfo.setMobilePhone(account.getMobilePhone());
accountInfo.setName(account.getName());
accountInfo.setPassword("");
accountInfo.setCreatedTime(currentTime);
accountInfo.setCreatedId(0);
......
package com.pica.cloud.account.account.server.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.pica.cloud.account.account.common.req.DocInfoReq;
import com.pica.cloud.account.account.common.req.DocInfoResp;
import com.pica.cloud.account.account.common.req.circle.CircleAcctInit;
import com.pica.cloud.account.account.common.req.circle.CircleAcctInitReq;
import com.pica.cloud.account.account.common.req.circle.DiyAcctInit;
......@@ -75,6 +77,45 @@ public class CircleAccountServiceImpl implements CircleAccountService {
return savedIds;
}
/**
* @param initAccoutsReq
* @return
*/
@Override
public List<DocInfoResp> createFollowupAccount(List<DocInfoReq> initAccoutsReq) {
List<DocInfoResp> respList = new ArrayList<>();
for (DocInfoReq acct : initAccoutsReq) {
DocInfoResp resp = new DocInfoResp();
try {
String encryMobile = EncryptUtils.encryptContent(acct.getMobile(), EncryptConstants.ENCRYPT_TYPE_MOBILE);
Account dbAcct = accountMapper.getByMobilePhone(encryMobile); //获取医生表账号信息
if (null == dbAcct) {
Account account = new Account();
account.setName(acct.getName());
account.setNickname(acct.getName());
account.setMobilePhone(encryMobile);
account.setRegisterSource(acct.getSource());
accountService.createAccount(account, null);
logger.info("createFollowupAccount insert {}", account.getId().intValue());
resp.setDoctorId(account.getId().intValue());
resp.setSeq(acct.getSeq());
} else {
resp.setDoctorId(dbAcct.getId().intValue());
resp.setSeq(acct.getSeq());
logger.info("createFollowupAccount exist {}", dbAcct.getId().intValue());
}
} catch (Exception e) {
logger.error("createFollowupAccount error:{}", e.getMessage());
resp.setDoctorId(0);
}
respList.add(resp);
}
return respList;
}
@Override
public List<Integer> createDiyAccount(DiyAcctInitReq diyAcctInitReq) {
logger.info("createDiyAccount:{}", JSONObject.toJSONString(diyAcctInitReq));
......@@ -163,18 +204,18 @@ public class CircleAccountServiceImpl implements CircleAccountService {
@Transactional
@Override
public List<Integer> registerAndCertify(DiyAcctInitReq diyAcctInitReq) {
if(!diyAcctInitReq.getCode().equals("618")){
if (!diyAcctInitReq.getCode().equals("618")) {
return null;
}
logger.info("createDiyAccount:{}", JSONObject.toJSONString(diyAcctInitReq));
List<Integer> savedIds = new ArrayList<>();
Map<Integer,DiyAcctInit> idCardMap = new HashMap<>();
Map<Integer, DiyAcctInit> idCardMap = new HashMap<>();
try {
if (CollectionUtils.isNotEmpty(diyAcctInitReq.getDiyAcctInitList())) {
for (DiyAcctInit acctInit : diyAcctInitReq.getDiyAcctInitList()) {
if(!checkIdNum(acctInit.getCard())){
if (!checkIdNum(acctInit.getCard())) {
throw new PicaException(PicaResultCode.PARAM_IS_INVALID.code(), "身份证号格式错误:" + acctInit.getCard());
}
......@@ -203,7 +244,7 @@ public class CircleAccountServiceImpl implements CircleAccountService {
}
// 对这批医生进行实名认证状态更新;
for(Integer id : savedIds){
for (Integer id : savedIds) {
try {
// check 身份证号是否已被他人使用
String encryCard = EncryptUtils.encryptContent(idCardMap.get(id).getCard(), EncryptConstants.ENCRYPT_TYPE_DOCTOR_IDNO);
......@@ -211,22 +252,22 @@ public class CircleAccountServiceImpl implements CircleAccountService {
Account accountCard = accountMapper.getByCard(encryCard);
String encryMobile = EncryptUtils.encryptContent(idCardMap.get(id).getDecryMobile(), EncryptConstants.ENCRYPT_TYPE_MOBILE);
if(accountCard != null && !accountCard.getMobilePhone().equals(encryMobile)){
if (accountCard != null && !accountCard.getMobilePhone().equals(encryMobile)) {
throw new PicaException(PicaResultCode.PARAM_IS_INVALID.code(), "身份证号已被使用:" + idCardMap.get(id).getCard());
}
Account doctor = accountMapper.selectById(id);
boolean updateFlag = false;
if(doctor.getStatus() != null && doctor.getStatus() != 3){
if (doctor.getStatus() != null && doctor.getStatus() != 3) {
doctor.setStatus(3);
updateFlag = true;
}
if(doctor.getCertifyStatus() != null && doctor.getCertifyStatus() != 3){
if (doctor.getCertifyStatus() != null && doctor.getCertifyStatus() != 3) {
doctor.setCertifyStatus(3);
updateFlag = true;
}
if(!updateFlag){
if (!updateFlag) {
continue;
}
doctor.setName(idCardMap.get(id).getUserName());
......@@ -249,7 +290,7 @@ public class CircleAccountServiceImpl implements CircleAccountService {
}
public static void main(String[] args) {
Map map =getBirthdayAgeSex("310115198210277251");
Map map = getBirthdayAgeSex("310115198210277251");
System.out.println(map);
}
......@@ -273,14 +314,14 @@ public class CircleAccountServiceImpl implements CircleAccountService {
boolean flag = true;
if (number.length == 15) {
for (int x = 0; x < number.length; x++) {
if (!flag){
if (!flag) {
return new HashMap<String, String>();
}
flag = Character.isDigit(number[x]);
}
} else if (number.length == 18) {
for (int x = 0; x < number.length - 1; x++) {
if (!flag){
if (!flag) {
return new HashMap<String, String>();
}
flag = Character.isDigit(number[x]);
......
......@@ -265,7 +265,7 @@ public class LoginServiceImpl implements LoginService {
private LoginResult pwdLoginCorrect(BaseRequest request, String mobile, String encrypt, AccountInfoEntity accountInfoEntity) {
//接入新旭事务一致性
String batchNo = IntactUtils.getUUID();
intactUtil.sendIntact(batchNo, "pwdLoginCorrect", com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_1, "request:" + JSON.toJSONString(request) + ",+mobile:" + mobile + ",encrypt:" + encrypt + ",accountInfoEntity:" + JSON.toJSONString(accountInfoEntity));
// intactUtil.sendIntact(batchNo, "pwdLoginCorrect", com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_1, "request:" + JSON.toJSONString(request) + ",+mobile:" + mobile + ",encrypt:" + encrypt + ",accountInfoEntity:" + JSON.toJSONString(accountInfoEntity));
Date currentTime = new Date();
Integer acctId = accountInfoEntity.getId();
int productType = request.getProductType();
......@@ -274,7 +274,7 @@ public class LoginServiceImpl implements LoginService {
doctorInfo = doctorInfoMapper.getDoctorInfoByMobile(encrypt);
if (null == doctorInfo) {
logger.error("此手机号无用户:{}", mobile);
intactUtil.sendIntact(batchNo, "pwdLoginCorrect", com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3, "request:" + JSON.toJSONString(request) + ",+mobile 此手机号无用户:" + mobile + ",encrypt:" + ",accountInfoEntity:" + JSON.toJSONString(accountInfoEntity));
// intactUtil.sendIntact(batchNo, "pwdLoginCorrect", com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3, "request:" + JSON.toJSONString(request) + ",+mobile 此手机号无用户:" + mobile + ",encrypt:" + ",accountInfoEntity:" + JSON.toJSONString(accountInfoEntity));
}
Integer userId = 0;
if (productType != AccountTypeEnum.PRODUCT_TYPE_HEALTH.getCode()) {
......@@ -309,7 +309,7 @@ public class LoginServiceImpl implements LoginService {
redisClient.del(pwdErrorNum);
}
}
intactUtil.sendIntact(batchNo, "pwdLoginCorrect", com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3, "request:" + JSON.toJSONString(request) + ",+mobile:" + mobile + ",encrypt:" + ",accountInfoEntity:" + JSON.toJSONString(accountInfoEntity));
// intactUtil.sendIntact(batchNo, "pwdLoginCorrect", com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3, "request:" + JSON.toJSONString(request) + ",+mobile:" + mobile + ",encrypt:" + ",accountInfoEntity:" + JSON.toJSONString(accountInfoEntity));
return result;
}
......@@ -1271,7 +1271,7 @@ public class LoginServiceImpl implements LoginService {
private SaasLoginResult pwdSaaSLoginCorrect(BaseRequest request, String mobile, String encrypt, AccountInfoEntity accountInfoEntity) {
//接入新旭事务一致性
String batchNo = IntactUtils.getUUID();
intactUtil.sendIntact(batchNo, "pwdLoginCorrect", com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_1, "request:" + JSON.toJSONString(request) + ",+mobile:" + mobile + ",encrypt:" + encrypt + ",accountInfoEntity:" + JSON.toJSONString(accountInfoEntity));
// intactUtil.sendIntact(batchNo, "pwdLoginCorrect", com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_1, "request:" + JSON.toJSONString(request) + ",+mobile:" + mobile + ",encrypt:" + encrypt + ",accountInfoEntity:" + JSON.toJSONString(accountInfoEntity));
Date currentTime = new Date();
Integer acctId = accountInfoEntity.getId();
int productType = request.getProductType();
......@@ -1280,7 +1280,7 @@ public class LoginServiceImpl implements LoginService {
doctorInfo = doctorInfoMapper.getDoctorInfoByMobile(encrypt);
if (null == doctorInfo) {
logger.error("此手机号无用户:{}", mobile);
intactUtil.sendIntact(batchNo, "pwdLoginCorrect", com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3, "request:" + JSON.toJSONString(request) + ",+mobile 此手机号无用户:" + mobile + ",encrypt:" + ",accountInfoEntity:" + JSON.toJSONString(accountInfoEntity));
// intactUtil.sendIntact(batchNo, "pwdLoginCorrect", com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3, "request:" + JSON.toJSONString(request) + ",+mobile 此手机号无用户:" + mobile + ",encrypt:" + ",accountInfoEntity:" + JSON.toJSONString(accountInfoEntity));
}
if(null == doctorInfo.getHospitalId() || 0 == doctorInfo.getHospitalId()){
throw new PicaException(AccountExceptionEnum.PICA_PARAMS_ERROR.getCode(), "请先加入机构");
......@@ -1321,7 +1321,7 @@ public class LoginServiceImpl implements LoginService {
result.setMobile(mobile);
result.setName(doctorInfo.getName());
result.setDoctorId(EncryptUtils.encryptContent(userId + "", EncryptConstants.ENCRYPT_TYPE_ID));
intactUtil.sendIntact(batchNo, "pwdLoginCorrect", com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3, "request:" + JSON.toJSONString(request) + ",+mobile:" + mobile + ",encrypt:" + ",accountInfoEntity:" + JSON.toJSONString(accountInfoEntity));
// intactUtil.sendIntact(batchNo, "pwdLoginCorrect", com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3, "request:" + JSON.toJSONString(request) + ",+mobile:" + mobile + ",encrypt:" + ",accountInfoEntity:" + JSON.toJSONString(accountInfoEntity));
return result;
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册