提交 7022fdae 编写于 作者: zhehao.chen's avatar zhehao.chen

Merge branch 'release' into 'master'

Release

See merge request !73
流水线 #36606 已失败 于阶段
......@@ -11,7 +11,7 @@
<groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-client</artifactId>
<version>1.0.4.5</version>
<version>1.0.5.1</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.9</version>
<version>1.0.2.0</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
......
package com.pica.cloud.account.account.client;
import com.pica.cloud.account.account.common.req.AccountInfoReq;
import com.pica.cloud.account.account.common.resp.DoctorUnionResp;
import com.pica.cloud.foundation.entity.PicaResponse;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;
......@@ -32,4 +33,8 @@ public interface AccountInfoClient {
@GetMapping(value = "/account/account/innerDoctors")
PicaResponse<List<Integer>> getDoctorsByInnerOrg();
@GetMapping(value = "/account/info/doctor/union")
PicaResponse<DoctorUnionResp> getDoctorByUnionid( @RequestParam(value = "unionid") String unionid);
}
......@@ -34,5 +34,6 @@ public interface RegisterClient {
@PostMapping(value = "/account/shop/acct")
PicaResponse<Map<String,Integer>> shopRegister(@RequestBody ShopAcctInitReq shopAcctInitReq, @RequestHeader(value = "token") String token);
@PostMapping("/account/account/login-register/v1")
PicaResponse<LoginResult> loginRegister(@RequestBody EncryptEntity entity);
}
\ No newline at end of file
......@@ -11,7 +11,7 @@
<groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-common</artifactId>
<version>1.0.1.9</version>
<version>1.0.2.0</version>
<name>pica-cloud-account-common</name>
<packaging>jar</packaging>
......
......@@ -2,9 +2,13 @@ package com.pica.cloud.account.account.common.req.circle;
public class DiyAcctInit {
private String userName;
private String userName; //真实姓名
private String decryMobile;
private String decryMobile; //明文手机
private String card; //明文 身份证
private String nativePlace; //身份证地址 可以为空
public String getUserName() {
return userName;
......@@ -21,4 +25,20 @@ public class DiyAcctInit {
public void setDecryMobile(String decryMobile) {
this.decryMobile = decryMobile;
}
public String getCard() {
return card;
}
public void setCard(String card) {
this.card = card;
}
public String getNativePlace() {
return nativePlace;
}
public void setNativePlace(String nativePlace) {
this.nativePlace = nativePlace;
}
}
......@@ -4,6 +4,8 @@ import java.util.List;
public class DiyAcctInitReq {
private String code;
private List<String> decryMobileList;
private List<DiyAcctInit> diyAcctInitList;
......@@ -23,4 +25,12 @@ public class DiyAcctInitReq {
public void setDecryMobileList(List<String> decryMobileList) {
this.decryMobileList = decryMobileList;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}
package com.pica.cloud.account.account.common.resp;
import io.swagger.annotations.ApiModel;
/**
* 根据医生unionid查询医生是否存在
* @author wangxinxu
* @create 2020/12/28
*/
@ApiModel
public class DoctorUnionResp {
private Integer doctorId;
private Integer status;
public Integer getDoctorId() {
return doctorId;
}
public void setDoctorId(Integer doctorId) {
this.doctorId = doctorId;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
}
......@@ -151,7 +151,7 @@
<dependency>
<groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-common</artifactId>
<version>1.0.1.9</version>
<version>1.0.2.0</version>
</dependency>
<dependency>
......@@ -226,7 +226,7 @@
<dependency>
<groupId>com.pica.cloud.foundation</groupId>
<artifactId>pica-cloud-proof-client</artifactId>
<version>1.0.1</version>
<version>1.0.2</version>
<exclusions>
<exclusion>
<groupId>io.swagger</groupId>
......@@ -253,6 +253,11 @@
<!-- </exclusions>-->
<!-- </dependency>-->
<dependency>
<groupId>com.pica.cloud.foundation</groupId>
<artifactId>pica-cloud-message-client</artifactId>
<version>1.0.6-SNAPSHOT</version>
</dependency>
</dependencies>
<dependencyManagement>
......
package com.pica.cloud.account.account.server.controller;
import com.pica.cloud.account.account.common.req.AccountInfoReq;
import com.pica.cloud.account.account.common.resp.DoctorUnionResp;
import com.pica.cloud.account.account.server.entity.AccountWeChatInfoEntity;
import com.pica.cloud.account.account.server.service.AccountInfoService;
import com.pica.cloud.account.account.server.service.WechatService;
......@@ -8,7 +9,6 @@ import com.pica.cloud.foundation.entity.PicaResponse;
import com.pica.cloud.foundation.service.starter.interceptor.EnabledLoginValidate;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......@@ -66,4 +66,11 @@ public class AccountInfoController extends AccountBaseController {
return PicaResponse.toResponse(wechatService.getAccountWechatInfoBatch(docIds));
}
@ApiOperation(value = "根据unionid查看个人认证信息")
@GetMapping(value = "/doctor/union", produces = "application/json;charset=UTF-8")
public PicaResponse<DoctorUnionResp> getDoctorByUnionid(@RequestParam(value = "unionid") String unionid) {
DoctorUnionResp personalInfoDto = wechatService.getDoctorByUnionid(unionid);
return PicaResponse.toResponse(personalInfoDto);
}
}
......@@ -225,7 +225,7 @@ public class AutoCodeController extends AccountBaseController {
public PicaResponse getJigsawCode(@RequestBody EncryptEntity entity,
HttpServletRequest req) throws Exception {
BaseRequest request = CryptoUtil.decrypt(entity, BaseRequest.class);
return PicaResponse.toResponse(authCodeService.getJigsawCode(req, super.getSourceType(), request.getMobile()));
return PicaResponse.toResponse(authCodeService.getJigsawCode(req, super.getSourceType(), request.getMobile(), request.getJigsawVersion()));
}
@ApiOperation("微信获取验证码")
......
......@@ -42,4 +42,10 @@ public class CircleUserController {
return PicaResponse.toResponse(circleAccountService.createDiyAccount(diyAcctInitReq));
}
@PostMapping("/acct/registerAndCertify")
@EnabledLoginValidate
public PicaResponse<List<Integer>> registerAndCertify(@RequestBody DiyAcctInitReq diyAcctInitReq) {
return PicaResponse.toResponse(circleAccountService.registerAndCertify(diyAcctInitReq));
}
}
......@@ -4,6 +4,7 @@ import com.pica.cloud.account.account.server.entity.AccountUser;
import com.pica.cloud.account.account.server.entity.Doctor;
import com.pica.cloud.account.account.server.enums.AccountExceptionEnum;
import com.pica.cloud.account.account.server.exception.AccountException;
import com.pica.cloud.account.account.server.req.DoctorReq;
import com.pica.cloud.account.account.server.req.RevertAcctsReq;
import com.pica.cloud.account.account.server.service.DoctorService;
import com.pica.cloud.account.account.server.util.AccountUtils;
......@@ -60,6 +61,15 @@ public class DoctorController extends AccountBaseController {
return PicaResponse.toResponse();
}
@ApiOperation("注册完新用户 完善信息接口")
@PutMapping(value = "/register/welcome", produces = "application/json;charset=utf-8")
@EnabledLoginValidate
public PicaResponse registerWelcome(@RequestBody DoctorReq doctorReq) {
doctorReq.setId(fetchPicaUser().getId());
doctorService.registerWelcome(doctorReq);
return PicaResponse.toResponse();
}
/**
* 当前医生是哪个admin账户添加的
*
......
package com.pica.cloud.account.account.server.controller;
import com.alibaba.fastjson.JSONObject;
import com.pica.cloud.account.account.server.entity.AesBean.AesAuthCodeReq;
import com.pica.cloud.account.account.server.entity.EncryptEntity;
import com.pica.cloud.account.account.server.entity.LogLoginAes;
import com.pica.cloud.account.account.server.entity.LoginResult;
import com.pica.cloud.account.account.server.enums.SourceTypeEnum;
import com.pica.cloud.account.account.server.req.BaseRequest;
import com.pica.cloud.account.account.server.req.OneClickLoginReq;
import com.pica.cloud.account.account.server.service.LoginService;
import com.pica.cloud.account.account.server.service.LoginV1Service;
import com.pica.cloud.account.account.server.util.AccountUtils;
import com.pica.cloud.account.account.server.util.CryptoUtil;
import com.pica.cloud.account.account.server.util.RSAUtil;
import com.pica.cloud.foundation.entity.PicaResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Api(description = "登录注册相关接口 v1.0")
@RestController
@RequestMapping("v1/login")
public class LoginV1Controller extends AccountBaseController {
private Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private LoginV1Service loginV1Service;
@Autowired
private LoginService loginService;
@ApiOperation(value = "app端手机号码一键登录 v1")
@PostMapping("one_click")
public PicaResponse<LoginResult> oneClickLogin(@RequestBody AesAuthCodeReq aesReq) throws Exception {
EncryptEntity entity = new EncryptEntity();
entity.setKey(aesReq.getKey());
entity.setContent(aesReq.getContent());
OneClickLoginReq req = CryptoUtil.decrypt(entity, OneClickLoginReq.class);
req.setProductType(super.getProductType());
req.setSourceType(super.getSourceType());
req.setLoginIp(super.getIpAddr());
req.setUserTokenTourist(super.getUserTokenTourist());
logger.info("one-click req:{}", JSONObject.toJSONString(req));
LoginResult oneClickLoginResultVo = loginV1Service.oneClickLoginV1(req);
return PicaResponse.toResponse(oneClickLoginResultVo);
}
@ApiOperation(value = "手机号统一校验")
@PostMapping("/unifiedVerification")
public PicaResponse unifiedVerification(@RequestBody AesAuthCodeReq req) throws Exception {
EncryptEntity entity = new EncryptEntity();
entity.setKey(req.getKey());
entity.setContent(req.getContent());
BaseRequest request = CryptoUtil.decrypt(entity, BaseRequest.class);
request.setSourceType(super.getSourceType());
logger.info("v1/login/unifiedVerification:{}", JSONObject.toJSONString(request));
loginV1Service.mobileValidate(request);
return PicaResponse.toResponse();
}
/**
* 密码登录接口(app、H5、web --> v1)
*
* @param authCodeReq
* @return
* @throws Exception
*/
@ApiOperation("密码登录接口")
@PostMapping("/password")
public PicaResponse<LoginResult> v1LoginPassword(@RequestBody AesAuthCodeReq authCodeReq) throws Exception {
EncryptEntity entity = new EncryptEntity();
entity.setKey(authCodeReq.getKey());
entity.setContent(authCodeReq.getContent());
BaseRequest request = CryptoUtil.decrypt(entity, BaseRequest.class);
request.setProductType(super.getProductType());
Integer sourceType = super.getSourceType();
request.setSourceType(sourceType == null ? 0 : sourceType);
request.setLoginIp(super.getIpAddr());
request.setUserTokenTourist(super.getUserTokenTourist());
AccountUtils.checkMobilePhone(request.getMobile());
AccountUtils.checkPassword(request.getPassword());
LoginResult login = loginV1Service.v1LoginPassword(request);
if (SourceTypeEnum.SAAS.getCode().equals(sourceType)) {
login.setDoctorId("");
} else {
login.setUserId(null);
}
return PicaResponse.toResponse(login);
}
}
......@@ -24,6 +24,12 @@ public class Account {
@ApiModelProperty("认证状态 1未认证,2认证中,3认证通过,4认证不通过,5验证码认证,6 重新认证中,7 重新认证失败")
private Integer status;
private Integer certifyStatus;
private String nation;
private String nativePlace;
private String avatarImageUrl;
private String email;
......@@ -69,6 +75,30 @@ public class Account {
private Date birthday;
public String getNativePlace() {
return nativePlace;
}
public void setNativePlace(String nativePlace) {
this.nativePlace = nativePlace;
}
public String getNation() {
return nation;
}
public void setNation(String nation) {
this.nation = nation;
}
public Integer getCertifyStatus() {
return certifyStatus;
}
public void setCertifyStatus(Integer certifyStatus) {
this.certifyStatus = certifyStatus;
}
public Long getId() {
return id;
}
......
......@@ -34,6 +34,17 @@ public class AesAuthCodeReq {
*/
private String content;
// 是否需要校验该设备登录的手机号
private Boolean checkFlag = false;
public Boolean getCheckFlag() {
return checkFlag;
}
public void setCheckFlag(Boolean checkFlag) {
this.checkFlag = checkFlag;
}
public Integer getBizType() {
return bizType;
}
......
package com.pica.cloud.account.account.server.entity;
import java.util.Date;
public class LogOneChlickCheck {
private Integer id;
private String deviceToken;
private String lastMobilePhone;
private String currMobilePhone;
private Boolean usedShanyan;
private String keepBack;
private Byte 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 String getDeviceToken() {
return deviceToken;
}
public void setDeviceToken(String deviceToken) {
this.deviceToken = deviceToken == null ? null : deviceToken.trim();
}
public String getLastMobilePhone() {
return lastMobilePhone;
}
public void setLastMobilePhone(String lastMobilePhone) {
this.lastMobilePhone = lastMobilePhone == null ? null : lastMobilePhone.trim();
}
public String getCurrMobilePhone() {
return currMobilePhone;
}
public void setCurrMobilePhone(String currMobilePhone) {
this.currMobilePhone = currMobilePhone == null ? null : currMobilePhone.trim();
}
public Boolean getUsedShanyan() {
return usedShanyan;
}
public void setUsedShanyan(Boolean usedShanyan) {
this.usedShanyan = usedShanyan;
}
public String getKeepBack() {
return keepBack;
}
public void setKeepBack(String keepBack) {
this.keepBack = keepBack == null ? null : keepBack.trim();
}
public Byte getDeleteFlag() {
return deleteFlag;
}
public void setDeleteFlag(Byte 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
......@@ -30,6 +30,45 @@ public class LoginResult {
@ApiModelProperty("accountinfo表主键id")
private Integer acctId;
private Boolean checkStatus = true;
private String suggestMessage;
private String differentMessage;
private String lastMobile;
public String getLastMobile() {
return lastMobile;
}
public void setLastMobile(String lastMobile) {
this.lastMobile = lastMobile;
}
public Boolean getCheckStatus() {
return checkStatus;
}
public void setCheckStatus(Boolean checkStatus) {
this.checkStatus = checkStatus;
}
public String getSuggestMessage() {
return suggestMessage;
}
public void setSuggestMessage(String suggestMessage) {
this.suggestMessage = suggestMessage;
}
public String getDifferentMessage() {
return differentMessage;
}
public void setDifferentMessage(String differentMessage) {
this.differentMessage = differentMessage;
}
public String getToken() {
return token;
......
......@@ -67,6 +67,9 @@ public enum AccountExceptionEnum {
PAT_QUERY_MAX("216558","查询参数过多"),
PICA_PASSWORD_RESET("216559", "您尚未设置密码,请退出登录后使用密码方式登录进行密码设置"),
MOBILE_NOT_REGISTER("216560", "手机号{mobile}尚未注册"),
PARAMS_BIZ_TYPE_EMPTY("216561", "参数bizType不能为空"),
PROOF_GET_FAIL("216562", "网络出了点问题,请稍后重试"),
xxx_xxx("","");
......
......@@ -27,6 +27,8 @@ public interface AccountMapper {
//根据手机号获取账号
Account getByMobilePhone(@Param("mobilePhone") String mobilePhone);
Account getByCard(@Param("card") String card);
//根据微信unionid获取账号
Account getByUnionid(@Param("unionid") String unionid);
......
package com.pica.cloud.account.account.server.mapper;
import com.pica.cloud.account.account.common.resp.DoctorUnionResp;
import com.pica.cloud.account.account.server.entity.Doctor;
import com.pica.cloud.account.account.server.entity.DoctorEntity;
import com.pica.cloud.account.account.server.entity.PICAPDoctor;
import com.pica.cloud.account.account.server.model.WechatInfoDto;
import org.apache.ibatis.annotations.Param;
......@@ -119,5 +119,7 @@ public interface DoctorMapper {
List<Integer> getDoctorsByInnerOrg(List<String> list);
DoctorUnionResp getDoctorByAcctId(Long acctId);
}
\ No newline at end of file
package com.pica.cloud.account.account.server.mapper;
import com.pica.cloud.account.account.server.entity.LogOneChlickCheck;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface LogOneChlickCheckMapper {
int deleteByPrimaryKey(Integer id);
int insert(LogOneChlickCheck record);
int insertSelective(LogOneChlickCheck record);
LogOneChlickCheck selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(LogOneChlickCheck record);
int updateByPrimaryKey(LogOneChlickCheck record);
int insertOne(LogOneChlickCheck record);
}
\ No newline at end of file
......@@ -54,6 +54,16 @@ public class BaseRequest {
private Integer imageW;
@ApiModelProperty("用户本地token")
private String userTokenTourist;
@ApiModelProperty("拼图version")
private String jigsawVersion;
public String getJigsawVersion() {
return jigsawVersion;
}
public void setJigsawVersion(String jigsawVersion) {
this.jigsawVersion = jigsawVersion;
}
public String getUserTokenTourist() {
return userTokenTourist;
......
package com.pica.cloud.account.account.server.req;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ApiModel
public class DoctorReq {
private Integer id;
@ApiModelProperty("姓名")
private String name;
@ApiModelProperty("科室")
private String department;
@ApiModelProperty("职称")
private String title;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDepartment() {
return department;
}
public void setDepartment(String department) {
this.department = department;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
}
......@@ -17,6 +17,27 @@ public class OneClickLoginReq {
private String userTokenTourist;
// 是否需要校验该设备登录的手机号
private Boolean checkFlag = false;
private String deviceToken;
public String getDeviceToken() {
return deviceToken;
}
public void setDeviceToken(String deviceToken) {
this.deviceToken = deviceToken;
}
public Boolean getCheckFlag() {
return checkFlag;
}
public void setCheckFlag(Boolean checkFlag) {
this.checkFlag = checkFlag;
}
public String getLoginIp() {
return loginIp;
}
......
......@@ -22,7 +22,7 @@ public interface AuthCodeService {
int validateJigsawCode(HttpServletRequest request, BaseRequest req);
JigsawCodeModel getJigsawCode(HttpServletRequest request, Integer sourceType, String mobile);
JigsawCodeModel getJigsawCode(HttpServletRequest request, Integer sourceType, String mobile, String jigsawVersion);
}
......@@ -24,4 +24,7 @@ public interface CircleAccountService {
Map<String,Integer> createShopAccount(ShopAcctInitReq shopAcctInitReq);
// 注册 并且 实名认证用户,临时接口 todo
List<Integer> registerAndCertify(DiyAcctInitReq diyAcctInitReq);
}
package com.pica.cloud.account.account.server.service;
import com.pica.cloud.account.account.server.entity.Doctor;
import com.pica.cloud.account.account.server.req.DoctorReq;
import java.util.List;
......@@ -26,6 +27,8 @@ public interface DoctorService {
*/
void modifyDoctorInfo(Doctor doctor,Long doctorId);
int registerWelcome(DoctorReq doctorReq);
/**
* 修改医生信息
*
......
......@@ -100,4 +100,5 @@ public interface LoginService {
int insertLoginAesLog(LogLoginAes aes);
LoginResult loginQRCode(BaseRequest request);
}
package com.pica.cloud.account.account.server.service;
import com.pica.cloud.account.account.server.entity.LoginResult;
import com.pica.cloud.account.account.server.req.OneClickLoginReq;
import com.pica.cloud.account.account.server.req.BaseRequest;
public interface LoginV1Service {
LoginResult oneClickLoginV1(OneClickLoginReq req);
void mobileValidate(BaseRequest request);
LoginResult v1LoginPassword(BaseRequest request);
void insertLog(Integer userId, String currMobilePhone, String deviceToken, String keepBack);
}
package com.pica.cloud.account.account.server.service;
import com.pica.cloud.account.account.common.resp.DoctorUnionResp;
import com.pica.cloud.account.account.server.entity.AccountWeChatInfoEntity;
import com.pica.cloud.foundation.utils.entity.PicaUser;
......@@ -12,4 +13,6 @@ public interface WechatService {
Map<Integer,String> getAccountWechatInfoBatch(List<Integer> docIds);
DoctorUnionResp getDoctorByUnionid(String unionid);
}
......@@ -287,7 +287,7 @@ public class AuthCodeServiceImpl implements AuthCodeService {
* @Return com.pica.cloud.account.account.server.model.JigsawCodeModel
*/
@Override
public JigsawCodeModel getJigsawCode(HttpServletRequest request, Integer sourceType, String mobile) {
public JigsawCodeModel getJigsawCode(HttpServletRequest request, Integer sourceType, String mobile, String jigsawVersion) {
if(!SourceTypeEnum.H5.getCode().equals(sourceType)) {
logger.error("getJigsawCode-h5 sourceType error");
throw new PicaWarnException(PicaResultCode.PARAM_IS_INVALID.code(), PicaResultCode.PARAM_IS_INVALID.message());
......@@ -304,12 +304,19 @@ public class AuthCodeServiceImpl implements AuthCodeService {
String key = Constants.JIGSAW_CODE_KEY.replace("{mobile}", mobile);
if (needCheck > 0) {
try {
picResp = sliderImageService.getPic();
if(null != jigsawVersion && jigsawVersion.equals("v1")){
// 新版获取 拼图(指定公司背景图)
picResp = sliderImageService.getPicV1();
}else {
picResp = sliderImageService.getPic();
}
logger.info("getJigsawCode-getPic-code:{}", picResp.getCode());
} catch (Exception e) {
logger.error("getJigsawCode-sliderImageService.getPic invoke exception", e.getMessage());
logger.error("getJigsawCode-getPic-code invoke exception:{}", e.getMessage());
// 记录该手机号调用接口获取拼图时接口报错
cacheClient.set(key, 100, Constants.JIGSAW_CODE_EXPIRE_SECONDS);
throw new PicaWarnException(AccountExceptionEnum.PROOF_GET_FAIL.getCode(),
AccountExceptionEnum.PROOF_GET_FAIL.getMessage());
}
if (Objects.nonNull(picResp)) {
if (!PicaResultCode.SUCCESS.code().equals(picResp.getCode())) {
......
......@@ -8,11 +8,13 @@ import com.pica.cloud.account.account.server.enums.AccountExceptionEnum;
import com.pica.cloud.account.account.server.enums.AccountTypeEnum;
import com.pica.cloud.account.account.server.exception.AccountException;
import com.pica.cloud.account.account.server.mapper.*;
import com.pica.cloud.account.account.server.req.DoctorReq;
import com.pica.cloud.account.account.server.service.DoctorService;
import com.pica.cloud.account.account.server.util.AESUtil;
import com.pica.cloud.account.account.server.util.AccountUtils;
import com.pica.cloud.foundation.encryption.common.constants.EncryptConstants;
import com.pica.cloud.foundation.encryption.util.EncryptUtils;
import com.pica.cloud.foundation.entity.PicaWarnException;
import com.pica.cloud.foundation.redis.ICacheClient;
import com.pica.cloud.foundation.utils.utils.StringUtil;
import org.apache.commons.lang3.StringUtils;
......@@ -91,6 +93,30 @@ public class DoctorServiceImpl implements DoctorService {
accountInfoDetailMapper.updateByPrimaryKeySelective(accountInfoEntity);
}
@Override
public int registerWelcome(DoctorReq doctorReq) {
logger.info("registerWelcome req:{}", JSONObject.toJSONString(doctorReq));
Doctor doctor = doctorMapper.selectByPrimaryKey(doctorReq.getId());
if (null == doctor) {
throw new PicaWarnException(AccountExceptionEnum.PICA_PARAMS_ERROR.getCode(),
AccountExceptionEnum.PICA_PARAMS_ERROR.getMessage());
}
/*if(StringUtil.isNotNull(doctorReq.getDepartment())){
doctor.setDepartment(doctorReq.getDepartment());
}
if(StringUtil.isNotNull(doctorReq.getTitle())){
doctor.setTitle(doctorReq.getTitle());
}*/
if (StringUtil.isNotNull(doctorReq.getName())) {
doctor.setName(doctorReq.getName());
doctor.setModifyTime(new Date());
doctor.setModifyId(doctorReq.getId());
return doctorMapper.updateByPrimaryKeySelective(doctor);
}
return 0;
}
@Transactional
@Override
public void deleteDoctorInfo(Integer id, Long modifyId) {
......@@ -211,15 +237,15 @@ public class DoctorServiceImpl implements DoctorService {
@Override
public List<Integer> getDoctorsByInnerOrg() {
String ids = cacheClient.get(Constants.INNER_ORG_IDS);
if(StringUtil.isEmpty(ids)){
if (StringUtil.isEmpty(ids)) {
List<Integer> dbIds = doctorMapper.getDoctorsByInnerOrg(null);
String arrStr = "";
for(Integer i : dbIds){
for (Integer i : dbIds) {
arrStr = arrStr + i + ",";
}
cacheClient.setex(Constants.INNER_ORG_IDS,arrStr,3600);
cacheClient.setex(Constants.INNER_ORG_IDS, arrStr, 3600);
return dbIds;
}else {
} else {
List<Integer> rtnIds = Arrays.asList(ids.split(",")).stream().filter(s -> !"".equals(s)).map(s -> Integer.parseInt(s)).collect(Collectors.toList());
return rtnIds;
}
......
package com.pica.cloud.account.account.server.service.impl;
import com.pica.cloud.account.account.common.resp.DoctorUnionResp;
import com.pica.cloud.account.account.server.entity.AccountUnionEntity;
import com.pica.cloud.account.account.server.entity.AccountWeChatInfoEntity;
import com.pica.cloud.account.account.server.mapper.AccountWeChatInfoMapper;
import com.pica.cloud.account.account.server.mapper.DoctorMapper;
import com.pica.cloud.account.account.server.model.WechatInfoDto;
import com.pica.cloud.account.account.server.service.AccountUnionService;
import com.pica.cloud.account.account.server.service.WechatService;
import com.pica.cloud.foundation.utils.entity.PicaUser;
import com.pica.cloud.foundation.utils.utils.StringUtil;
import io.swagger.models.auth.In;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
......@@ -28,6 +27,9 @@ public class WechatServiceImpl implements WechatService {
@Autowired
private AccountWeChatInfoMapper weChatInfoMapper;
@Autowired
private AccountUnionService accountUnionService;
@Override
public AccountWeChatInfoEntity getAccountWechatInfo(PicaUser user) {
String unionId = doctorMapper.getUnionIdByDoctorId(user.getId());
......@@ -72,4 +74,14 @@ public class WechatServiceImpl implements WechatService {
return doctorOpenMap;
}
@Override
public DoctorUnionResp getDoctorByUnionid(String unionid){
AccountUnionEntity accountUnionEntity = accountUnionService.selectInfoByUnionId(unionid);
DoctorUnionResp doctorUnionfoModel = new DoctorUnionResp();
if (StringUtil.isNotNull(accountUnionEntity)) {
doctorUnionfoModel = doctorMapper.getDoctorByAcctId(accountUnionEntity.getAcctId());
}
return doctorUnionfoModel;
}
}
......@@ -188,6 +188,8 @@ public class AESUtil {
public static void main(String[] args) throws Exception {
// String content = AESUtil.aesDecrypt(encryptEntity.getContent(),decryptKey);
String KEY="111";
System.out.println("-------------加密---------");
......
......@@ -9,6 +9,7 @@
<!-- <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"/>-->
<classPathEntry location="/Users/zhoupengcheng/mysql_jar/mysql-connector-java-5.1.49.jar"/>
<context id="tableEntity" targetRuntime="MyBatis3">
<commentGenerator>
......@@ -43,6 +44,7 @@
<!-- <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>-->
<table tableName="log_one_chlick_check" domainObjectName="LogOneChlickCheck" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
</context>
</generatorConfiguration>
......
......@@ -9,6 +9,8 @@
<result column="mobile_phone" jdbcType="VARCHAR" property="mobilePhone" />
<result column="acct_id" jdbcType="INTEGER" property="acctId" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="certify_status" jdbcType="INTEGER" property="certifyStatus" />
<result column="nation" jdbcType="VARCHAR" property="nation" />
<result column="avatar_image_url" jdbcType="VARCHAR" property="avatarImageUrl" />
<result column="email" jdbcType="VARCHAR" property="email" />
<result column="qrcode" jdbcType="VARCHAR" property="qrcode" />
......@@ -34,7 +36,7 @@
</resultMap>
<sql id="Base_Column_List">
id, sex, name, mobile_phone, status, avatar_image_url, email, qrcode, nickname, personal_sign, delete_flag,
id, sex, name, mobile_phone, status, certify_status, nation, avatar_image_url, email, qrcode, nickname, personal_sign, delete_flag,
creat_id, creat_time, modify_id, modify_time, password, info, entire_flag, reg_time, last_login_time,
unionid, register_source, comment, register_type, first_login_time, card, birthday
</sql>
......@@ -213,6 +215,18 @@
<update id="updateByIdSelective" parameterType="com.pica.cloud.account.account.server.entity.Account">
update p_doctor
<set>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="certifyStatus != null">
certify_status = #{certifyStatus,jdbcType=INTEGER},
</if>
<if test="nation != null">
nation = #{nation,jdbcType=VARCHAR},
</if>
<if test="nativePlace != null">
native_place = #{nativePlace,jdbcType=VARCHAR},
</if>
<if test="sex != null">
sex = #{sex,jdbcType=INTEGER},
</if>
......@@ -307,6 +321,14 @@
limit 1
</select>
<select id="getByCard" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from p_doctor
where card = #{card} and delete_flag = 1
limit 1
</select>
<select id="getHospitalInfoByPage" resultType="map">
select id, hospital_id, hospital,mobile_phone,name,
status, avatar_image_url, email,
......
......@@ -126,7 +126,7 @@
select
<include refid="Base_Column_List"/>
from p_doctor
where id = #{id} and delete_flag=1
where id = #{id} and delete_flag = 1
</select>
<!--删除用户-->
......@@ -1087,5 +1087,10 @@
select id from p_doctor where (hospital like ('云鹊%') or hospital LIKE ('测试%')) and delete_flag = 1;
</select>
<select id="getDoctorByAcctId" resultType="com.pica.cloud.account.account.common.resp.DoctorUnionResp" parameterType="java.lang.Long">
select d.id as doctorId, d.status
from p_doctor d
where d.acct_id = #{acctId} and d.delete_flag = 1
</select>
</mapper>
\ No newline at end of file
<?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.LogOneChlickCheckMapper" >
<resultMap id="BaseResultMap" type="com.pica.cloud.account.account.server.entity.LogOneChlickCheck" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="device_token" property="deviceToken" jdbcType="VARCHAR" />
<result column="last_mobile_phone" property="lastMobilePhone" jdbcType="VARCHAR" />
<result column="curr_mobile_phone" property="currMobilePhone" jdbcType="VARCHAR" />
<result column="used_shanyan" property="usedShanyan" jdbcType="BIT" />
<result column="keep_back" property="keepBack" jdbcType="VARCHAR" />
<result column="delete_flag" property="deleteFlag" jdbcType="TINYINT" />
<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, device_token, last_mobile_phone, curr_mobile_phone, used_shanyan, keep_back,
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 log_one_chlick_check
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from log_one_chlick_check
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.pica.cloud.account.account.server.entity.LogOneChlickCheck" >
insert into log_one_chlick_check (id, device_token, last_mobile_phone,
curr_mobile_phone, used_shanyan, keep_back,
delete_flag, created_id, created_time,
modified_id, modified_time)
values (#{id,jdbcType=INTEGER}, #{deviceToken,jdbcType=VARCHAR}, #{lastMobilePhone,jdbcType=VARCHAR},
#{currMobilePhone,jdbcType=VARCHAR}, #{usedShanyan,jdbcType=BIT}, #{keepBack,jdbcType=VARCHAR},
#{deleteFlag,jdbcType=TINYINT}, #{createdId,jdbcType=INTEGER}, #{createdTime,jdbcType=TIMESTAMP},
#{modifiedId,jdbcType=INTEGER}, #{modifiedTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.pica.cloud.account.account.server.entity.LogOneChlickCheck" >
insert into log_one_chlick_check
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="deviceToken != null" >
device_token,
</if>
<if test="lastMobilePhone != null" >
last_mobile_phone,
</if>
<if test="currMobilePhone != null" >
curr_mobile_phone,
</if>
<if test="usedShanyan != null" >
used_shanyan,
</if>
<if test="keepBack != null" >
keep_back,
</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="deviceToken != null" >
#{deviceToken,jdbcType=VARCHAR},
</if>
<if test="lastMobilePhone != null" >
#{lastMobilePhone,jdbcType=VARCHAR},
</if>
<if test="currMobilePhone != null" >
#{currMobilePhone,jdbcType=VARCHAR},
</if>
<if test="usedShanyan != null" >
#{usedShanyan,jdbcType=BIT},
</if>
<if test="keepBack != null" >
#{keepBack,jdbcType=VARCHAR},
</if>
<if test="deleteFlag != null" >
#{deleteFlag,jdbcType=TINYINT},
</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>
<update id="updateByPrimaryKeySelective" parameterType="com.pica.cloud.account.account.server.entity.LogOneChlickCheck" >
update log_one_chlick_check
<set >
<if test="deviceToken != null" >
device_token = #{deviceToken,jdbcType=VARCHAR},
</if>
<if test="lastMobilePhone != null" >
last_mobile_phone = #{lastMobilePhone,jdbcType=VARCHAR},
</if>
<if test="currMobilePhone != null" >
curr_mobile_phone = #{currMobilePhone,jdbcType=VARCHAR},
</if>
<if test="usedShanyan != null" >
used_shanyan = #{usedShanyan,jdbcType=BIT},
</if>
<if test="keepBack != null" >
keep_back = #{keepBack,jdbcType=VARCHAR},
</if>
<if test="deleteFlag != null" >
delete_flag = #{deleteFlag,jdbcType=TINYINT},
</if>
<if test="createdId != null" >
created_id = #{createdId,jdbcType=INTEGER},
</if>
<if test="createdTime != null" >
created_time = #{createdTime,jdbcType=TIMESTAMP},
</if>
<if test="modifiedId != null" >
modified_id = #{modifiedId,jdbcType=INTEGER},
</if>
<if test="modifiedTime != null" >
modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.pica.cloud.account.account.server.entity.LogOneChlickCheck" >
update log_one_chlick_check
set device_token = #{deviceToken,jdbcType=VARCHAR},
last_mobile_phone = #{lastMobilePhone,jdbcType=VARCHAR},
curr_mobile_phone = #{currMobilePhone,jdbcType=VARCHAR},
used_shanyan = #{usedShanyan,jdbcType=BIT},
keep_back = #{keepBack,jdbcType=VARCHAR},
delete_flag = #{deleteFlag,jdbcType=TINYINT},
created_id = #{createdId,jdbcType=INTEGER},
created_time = #{createdTime,jdbcType=TIMESTAMP},
modified_id = #{modifiedId,jdbcType=INTEGER},
modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<insert id="insertOne" parameterType="com.pica.cloud.account.account.server.entity.LogOneChlickCheck" >
insert into log_one_chlick_check (device_token, last_mobile_phone,
curr_mobile_phone, used_shanyan, keep_back,
delete_flag, created_id, created_time,
modified_id, modified_time)
values (#{deviceToken,jdbcType=VARCHAR}, #{lastMobilePhone,jdbcType=VARCHAR},
#{currMobilePhone,jdbcType=VARCHAR}, #{usedShanyan,jdbcType=BIT}, #{keepBack,jdbcType=VARCHAR},
#{deleteFlag,jdbcType=TINYINT}, #{createdId,jdbcType=INTEGER}, #{createdTime,jdbcType=TIMESTAMP},
#{modifiedId,jdbcType=INTEGER}, #{modifiedTime,jdbcType=TIMESTAMP})
</insert>
</mapper>
\ No newline at end of file
// Copyright 2016-2101 Pica.
package pica.cloud.account.account.server.mapper;
import com.pica.cloud.account.account.server.App;
import com.pica.cloud.account.account.server.service.LoginV1Service;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
/**
* @ClassName AutoCodeControllerTest
* @Description
* @Author Chongwen.jiang
* @Date 2020/4/3 14:31
* @ModifyDate 2020/4/3 14:31
* @Version 1.0
*/
@RunWith(SpringRunner.class)
@SpringBootTest (classes = App.class)
public class OneClickTest {
@Autowired
LoginV1Service loginV1Service;
@Test
public void test() {
loginV1Service.insertLog(1000005511, "13073690113", "161a397c8bc807ed97",
"{baseRequest={\\\"flag\\\":0,\\\"loginIp\\\":\\\"172.25.36.64\\\",\\\"mobile\\\":\\\"13073690113\\\",\\\"productType\\\":1,\\\"sourceType\\\":2,\\\"userTokenTourist\\\":\\\"06388870914559557010\\\"}, accountInfoEntity={\\\"age\\\":0,\\\"createdId\\\":49,\\\"createdTime\\\":1586336527000,\\\"deleteFlag\\\":1,\\\"id\\\":49,\\\"mobilePhone\\\":\\\"N/rge2EqV+KgL+li6YBfag==\\\",\\\"modifiedId\\\":49,\\\"modifiedTime\\\":1606982710000,\\\"name\\\":\\\"\\\",\\\"password\\\":\\\"F6127053CB61F3A162F79C031302EAA9\\\",\\\"regTime\\\":1586336527000,\\\"registerProduct\\\":1,\\\"registerSource\\\":1,\\\"sex\\\":0}, queryMobileEntity={\\\"chargeStatus\\\":1,\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"mobileName\\\":\\\"8A7285AA29407E465B2E89053D32FB2E\\\",\\\"tradeNo\\\":\\\"790607755953070080\\\"},\\\"message\\\":\\\"成功\\\",\\\"mobile\\\":\\\"13073690113\\\",\\\"sourceType\\\":2}, req={\\\"checkFlag\\\":true,\\\"deviceToken\\\":\\\"161a3797c8bc807ed97\\\",\\\"loginIp\\\":\\\"172.25.36.64\\\",\\\"productType\\\":1,\\\"sourceType\\\":2,\\\"token\\\":\\\"A4-PAYG_0uR5Q3IeSPcQaN9mPZs20iUJPGDxQWMcNiipcrrsuN-fkr0R3dZad4_c_o5vMRFIfQo0oJiE5owd6-xN8f71byCQ8FIFuWKnxj_1AvoGrrmXBmYNu4bwA4Cinw247d_42lC6bxPxB9d-Bnl8SqBNdqX3HHWYTCtswZaT9Ig2H-9R6j9vaa4yMo9DX5mAUVJMNMQi58NcbfpcSnxPw==\\\",\\\"userTokenTourist\\\":\\\"06388870914559557010\\\"}}");
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册