Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-cloud-account
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.account
pica-cloud-account
提交
753091e7
提交
753091e7
编写于
10月 24, 2019
作者:
dong.an
浏览文件
操作
浏览文件
下载
差异文件
merge
上级
3b779f2b
f78660ea
流水线
#16217
已失败 于阶段
in 0 second
变更
107
流水线
1
显示空白字符变更
内嵌
并排
正在显示
107 个修改的文件
包含
12084 行增加
和
42 行删除
+12084
-42
pom.xml
client/pom.xml
+2
-2
RegisterClient.java
...com/pica/cloud/account/account/client/RegisterClient.java
+25
-0
pom.xml
common/pom.xml
+1
-1
EncryptEntity.java
.../pica/cloud/account/account/common/req/EncryptEntity.java
+40
-0
LoginResult.java
...om/pica/cloud/account/account/common/req/LoginResult.java
+64
-0
OCINRequest.java
...om/pica/cloud/account/account/common/req/OCINRequest.java
+78
-0
pom.xml
server/pom.xml
+6
-1
Test.java
...main/java/com/pica/cloud/account/account/server/Test.java
+155
-0
Constants.java
...ica/cloud/account/account/server/constants/Constants.java
+34
-2
AccountBaseController.java
...ount/account/server/controller/AccountBaseController.java
+65
-2
AccountController.java
.../account/account/server/controller/AccountController.java
+83
-12
AutoCodeController.java
...account/account/server/controller/AutoCodeController.java
+169
-0
CipherController.java
...d/account/account/server/controller/CipherController.java
+30
-0
DoctorController.java
...d/account/account/server/controller/DoctorController.java
+73
-0
LoginController.java
...ud/account/account/server/controller/LoginController.java
+173
-0
ModifyMobileController.java
...unt/account/server/controller/ModifyMobileController.java
+37
-0
PasswordController.java
...account/account/server/controller/PasswordController.java
+72
-0
PatientInfoController.java
...ount/account/server/controller/PatientInfoController.java
+77
-0
RegisterController.java
...account/account/server/controller/RegisterController.java
+83
-0
TokenController.java
...ud/account/account/server/controller/TokenController.java
+35
-0
Account.java
...com/pica/cloud/account/account/server/entity/Account.java
+10
-0
AccountInfoEntity.java
...loud/account/account/server/entity/AccountInfoEntity.java
+165
-0
AccountPatientInfoEntity.java
...count/account/server/entity/AccountPatientInfoEntity.java
+315
-0
AccountUnionEntity.java
...oud/account/account/server/entity/AccountUnionEntity.java
+95
-0
AccountUser.java
...pica/cloud/account/account/server/entity/AccountUser.java
+59
-0
AccountWeChatInfoEntity.java
...ccount/account/server/entity/AccountWeChatInfoEntity.java
+225
-0
AgreementEntity.java
.../cloud/account/account/server/entity/AgreementEntity.java
+96
-0
AgreementLogEntity.java
...oud/account/account/server/entity/AgreementLogEntity.java
+95
-0
Doctor.java
.../com/pica/cloud/account/account/server/entity/Doctor.java
+615
-0
DoctorEntity.java
...ica/cloud/account/account/server/entity/DoctorEntity.java
+513
-0
EncryptEntity.java
...ca/cloud/account/account/server/entity/EncryptEntity.java
+40
-0
LogLoginEntity.java
...a/cloud/account/account/server/entity/LogLoginEntity.java
+152
-0
LogPWDModifyEntity.java
...oud/account/account/server/entity/LogPWDModifyEntity.java
+97
-0
LogUserInfoEntity.java
...loud/account/account/server/entity/LogUserInfoEntity.java
+297
-0
LoginResult.java
...pica/cloud/account/account/server/entity/LoginResult.java
+65
-0
LoginResultWeb.java
...a/cloud/account/account/server/entity/LoginResultWeb.java
+39
-0
PICAPDoctor.java
...pica/cloud/account/account/server/entity/PICAPDoctor.java
+533
-0
PICAPDoctorEducation.java
...d/account/account/server/entity/PICAPDoctorEducation.java
+147
-0
WeChatEntity.java
...ica/cloud/account/account/server/entity/WeChatEntity.java
+66
-0
WeChatUserInfoEntity.java
...d/account/account/server/entity/WeChatUserInfoEntity.java
+156
-0
AccountAgreementEnum.java
...ud/account/account/server/enums/AccountAgreementEnum.java
+28
-0
AccountExceptionEnum.java
...ud/account/account/server/enums/AccountExceptionEnum.java
+55
-0
AccountTypeEnum.java
...a/cloud/account/account/server/enums/AccountTypeEnum.java
+76
-0
AccountException.java
...ud/account/account/server/exception/AccountException.java
+25
-0
AccountLogEntity.java
...ca/cloud/account/account/server/log/AccountLogEntity.java
+20
-0
AccountLogEntityUtils.java
...oud/account/account/server/log/AccountLogEntityUtils.java
+63
-0
AccountLogTask.java
...pica/cloud/account/account/server/log/AccountLogTask.java
+55
-0
AccountLogUtils.java
...ica/cloud/account/account/server/log/AccountLogUtils.java
+25
-0
AccountInfoDetailMapper.java
...ccount/account/server/mapper/AccountInfoDetailMapper.java
+52
-0
AccountPatientInfoMapper.java
...count/account/server/mapper/AccountPatientInfoMapper.java
+51
-0
AccountUnionMapper.java
...oud/account/account/server/mapper/AccountUnionMapper.java
+38
-0
AccountWeChatInfoMapper.java
...ccount/account/server/mapper/AccountWeChatInfoMapper.java
+27
-0
AgreementEntityMapper.java
.../account/account/server/mapper/AgreementEntityMapper.java
+29
-0
AgreementLogEntityMapper.java
...count/account/server/mapper/AgreementLogEntityMapper.java
+18
-0
DoctorMapper.java
...ica/cloud/account/account/server/mapper/DoctorMapper.java
+82
-0
LogLoginMapper.java
...a/cloud/account/account/server/mapper/LogLoginMapper.java
+19
-0
LogPWDModifyMapper.java
...oud/account/account/server/mapper/LogPWDModifyMapper.java
+18
-0
LogUserInfoMapper.java
...loud/account/account/server/mapper/LogUserInfoMapper.java
+18
-0
QueueConfig.java
.../pica/cloud/account/account/server/queue/QueueConfig.java
+49
-0
QueueProducer.java
...ica/cloud/account/account/server/queue/QueueProducer.java
+26
-0
BaseRequest.java
...om/pica/cloud/account/account/server/req/BaseRequest.java
+149
-0
PatientReq.java
...com/pica/cloud/account/account/server/req/PatientReq.java
+300
-0
AccountUnionService.java
...d/account/account/server/service/AccountUnionService.java
+15
-0
DoctorService.java
...a/cloud/account/account/server/service/DoctorService.java
+46
-0
LoginService.java
...ca/cloud/account/account/server/service/LoginService.java
+55
-0
ModifyMobileService.java
...d/account/account/server/service/ModifyMobileService.java
+13
-0
PasswordService.java
...cloud/account/account/server/service/PasswordService.java
+22
-0
PatientInfoService.java
...ud/account/account/server/service/PatientInfoService.java
+39
-0
RegisterService.java
...cloud/account/account/server/service/RegisterService.java
+28
-0
TokenService.java
...ca/cloud/account/account/server/service/TokenService.java
+13
-0
AccountServiceImpl.java
...count/account/server/service/impl/AccountServiceImpl.java
+37
-9
AccountUnionServiceImpl.java
.../account/server/service/impl/AccountUnionServiceImpl.java
+19
-0
DoctorServiceImpl.java
...ccount/account/server/service/impl/DoctorServiceImpl.java
+119
-0
LoginServiceImpl.java
...account/account/server/service/impl/LoginServiceImpl.java
+348
-0
ModifyMobileServiceImpl.java
.../account/server/service/impl/ModifyMobileServiceImpl.java
+56
-0
PasswordServiceImpl.java
...ount/account/server/service/impl/PasswordServiceImpl.java
+104
-0
PatientInfoServerImpl.java
...nt/account/server/service/impl/PatientInfoServerImpl.java
+88
-0
RegisterServiceImpl.java
...ount/account/server/service/impl/RegisterServiceImpl.java
+246
-0
TokenServiceImpl.java
...account/account/server/service/impl/TokenServiceImpl.java
+59
-0
AESUtil.java
...a/com/pica/cloud/account/account/server/util/AESUtil.java
+169
-0
AccountUtils.java
.../pica/cloud/account/account/server/util/AccountUtils.java
+168
-0
BeanUtil.java
.../com/pica/cloud/account/account/server/util/BeanUtil.java
+30
-0
CryptoUtil.java
...om/pica/cloud/account/account/server/util/CryptoUtil.java
+72
-0
DateEntityUtils.java
...ca/cloud/account/account/server/util/DateEntityUtils.java
+10
-0
ExecutorServiceUtils.java
...oud/account/account/server/util/ExecutorServiceUtils.java
+16
-0
MessageUtils.java
.../pica/cloud/account/account/server/util/MessageUtils.java
+12
-0
MyX509TrustManager.java
...cloud/account/account/server/util/MyX509TrustManager.java
+24
-0
RSAUtil.java
...a/com/pica/cloud/account/account/server/util/RSAUtil.java
+150
-0
TokenUtils.java
...om/pica/cloud/account/account/server/util/TokenUtils.java
+93
-0
WeChatToolUtil.java
...ica/cloud/account/account/server/util/WeChatToolUtil.java
+360
-0
WeChatUtils.java
...m/pica/cloud/account/account/server/util/WeChatUtils.java
+117
-0
bootstrap-dev.properties
server/src/main/resources/bootstrap-dev.properties
+18
-6
bootstrap-prod.properties
server/src/main/resources/bootstrap-prod.properties
+11
-1
bootstrap-test1.properties
server/src/main/resources/bootstrap-test1.properties
+17
-2
bootstrap-test2.properties
server/src/main/resources/bootstrap-test2.properties
+17
-2
bootstrap-uat.properties
server/src/main/resources/bootstrap-uat.properties
+17
-2
AccountInfoEntityMapper.xml
...er/src/main/resources/mybatis/AccountInfoEntityMapper.xml
+252
-0
AccountMapper.xml
server/src/main/resources/mybatis/AccountMapper.xml
+7
-0
AccountUnionEntityMapper.xml
...r/src/main/resources/mybatis/AccountUnionEntityMapper.xml
+161
-0
AccountUserInfoEntityMapper.xml
...rc/main/resources/mybatis/AccountUserInfoEntityMapper.xml
+395
-0
AccountWeChatInfoEntityMapper.xml
.../main/resources/mybatis/AccountWeChatInfoEntityMapper.xml
+305
-0
AgreementEntityMapper.xml
server/src/main/resources/mybatis/AgreementEntityMapper.xml
+171
-0
AgreementLogEntityMapper.xml
...r/src/main/resources/mybatis/AgreementLogEntityMapper.xml
+143
-0
DoctorMapper.xml
server/src/main/resources/mybatis/DoctorMapper.xml
+1018
-0
LogLoginEntityMapper.xml
server/src/main/resources/mybatis/LogLoginEntityMapper.xml
+199
-0
LogPWDModifyEntityMapper.xml
...r/src/main/resources/mybatis/LogPWDModifyEntityMapper.xml
+144
-0
LogUserInfoEntityMapper.xml
...er/src/main/resources/mybatis/LogUserInfoEntityMapper.xml
+376
-0
未找到文件。
client/pom.xml
浏览文件 @
753091e7
...
@@ -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.
0
</version>
<version>
1.0.
1
</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.
0
</version>
<version>
1.0.
1
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<groupId>
org.springframework.cloud
</groupId>
...
...
client/src/main/java/com/pica/cloud/account/account/client/RegisterClient.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
client
;
import
com.pica.cloud.account.account.common.req.EncryptEntity
;
import
com.pica.cloud.account.account.common.req.LoginResult
;
import
com.pica.cloud.account.account.common.req.OCINRequest
;
import
com.pica.cloud.foundation.entity.PicaResponse
;
import
org.springframework.cloud.netflix.feign.FeignClient
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
/**
* Created on 2019/10/16 17:28
* author:crs
* Description:RegisterClient
*/
@FeignClient
(
name
=
"13201-pica-cloud-account"
)
public
interface
RegisterClient
{
@PostMapping
(
value
=
"/account/register"
)
PicaResponse
<
LoginResult
>
register
(
@RequestBody
EncryptEntity
entity
);
@PostMapping
(
value
=
"/account/register/ocin"
)
PicaResponse
register
(
@RequestBody
OCINRequest
ocinRequest
);
}
common/pom.xml
浏览文件 @
753091e7
...
@@ -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.
0
</version>
<version>
1.0.
1
</version>
<name>
pica-cloud-account-common
</name>
<name>
pica-cloud-account-common
</name>
<packaging>
jar
</packaging>
<packaging>
jar
</packaging>
...
...
common/src/main/java/com/pica/cloud/account/account/common/req/EncryptEntity.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
common
.
req
;
/**
* 加解密数据模型
*/
public
class
EncryptEntity
{
/**
* 加密后的密文
*/
private
String
key
;
/**
* 加密后的数据
*/
private
String
content
;
public
String
getKey
()
{
return
key
;
}
public
void
setKey
(
String
key
)
{
this
.
key
=
key
;
}
public
String
getContent
()
{
return
content
;
}
public
void
setContent
(
String
content
)
{
this
.
content
=
content
;
}
// @Override
// public String toString() {
// return "EncryptEntity{" +
// "key='" + key + '\'' +
// ", content='" + content + '\'' +
// '}';
// }
}
common/src/main/java/com/pica/cloud/account/account/common/req/LoginResult.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
common
.
req
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* Created on 2019/10/9 17:41
* author:crs
* Description: 登录状态返回
*/
@ApiModel
public
class
LoginResult
{
@ApiModelProperty
(
"token"
)
private
String
token
;
@ApiModelProperty
(
"用户id"
)
private
Long
userId
;
@ApiModelProperty
(
"是否绑定"
)
private
String
bindFlag
;
@ApiModelProperty
(
"联合登录id"
)
private
String
unionId
;
@ApiModelProperty
(
"是否完善过信息,1.信息未补全, 2信息已补全,3已补全密码"
)
private
int
entireFlag
;
public
String
getToken
()
{
return
token
;
}
public
void
setToken
(
String
token
)
{
this
.
token
=
token
;
}
public
Long
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
Long
userId
)
{
this
.
userId
=
userId
;
}
public
String
getBindFlag
()
{
return
bindFlag
;
}
public
void
setBindFlag
(
String
bindFlag
)
{
this
.
bindFlag
=
bindFlag
;
}
public
String
getUnionId
()
{
return
unionId
;
}
public
void
setUnionId
(
String
unionId
)
{
this
.
unionId
=
unionId
;
}
public
int
getEntireFlag
()
{
return
entireFlag
;
}
public
void
setEntireFlag
(
int
entireFlag
)
{
this
.
entireFlag
=
entireFlag
;
}
}
common/src/main/java/com/pica/cloud/account/account/common/req/OCINRequest.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
common
.
req
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* Created on 2019/10/16 16:46
* author:crs
* Description:ocin项目
*/
public
class
OCINRequest
{
public
String
mobile
;
private
String
name
;
private
Integer
hospitalId
;
private
Integer
flag
;
@ApiModelProperty
(
"产品线类型"
)
private
Integer
productType
;
@ApiModelProperty
(
"渠道来源"
)
private
Integer
sourceType
;
@ApiModelProperty
(
"登录ip"
)
private
String
loginIp
;
public
String
getMobile
()
{
return
mobile
;
}
public
void
setMobile
(
String
mobile
)
{
this
.
mobile
=
mobile
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
Integer
getHospitalId
()
{
return
hospitalId
;
}
public
void
setHospitalId
(
Integer
hospitalId
)
{
this
.
hospitalId
=
hospitalId
;
}
public
Integer
getFlag
()
{
return
flag
;
}
public
void
setFlag
(
Integer
flag
)
{
this
.
flag
=
flag
;
}
public
Integer
getProductType
()
{
return
productType
;
}
public
void
setProductType
(
Integer
productType
)
{
this
.
productType
=
productType
;
}
public
Integer
getSourceType
()
{
return
sourceType
;
}
public
void
setSourceType
(
Integer
sourceType
)
{
this
.
sourceType
=
sourceType
;
}
public
String
getLoginIp
()
{
return
loginIp
;
}
public
void
setLoginIp
(
String
loginIp
)
{
this
.
loginIp
=
loginIp
;
}
}
server/pom.xml
浏览文件 @
753091e7
...
@@ -74,6 +74,11 @@
...
@@ -74,6 +74,11 @@
</exclusions>
</exclusions>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-stream-rabbit
</artifactId>
</dependency>
<dependency>
<dependency>
<groupId>
com.pica.cloud.foundation
</groupId>
<groupId>
com.pica.cloud.foundation
</groupId>
<artifactId>
pica-cloud-utils
</artifactId>
<artifactId>
pica-cloud-utils
</artifactId>
...
@@ -111,7 +116,7 @@
...
@@ -111,7 +116,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.
0
</version>
<version>
1.0.
1
</version>
</dependency>
</dependency>
<dependency>
<dependency>
...
...
server/src/main/java/com/pica/cloud/account/account/server/Test.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
;
import
com.alibaba.fastjson.JSONObject
;
import
com.pica.cloud.account.account.server.entity.Doctor
;
import
com.pica.cloud.account.account.server.entity.EncryptEntity
;
import
com.pica.cloud.account.account.server.req.BaseRequest
;
import
com.pica.cloud.account.account.server.req.PatientReq
;
import
com.pica.cloud.account.account.server.util.AESUtil
;
import
com.pica.cloud.account.account.server.util.RSAUtil
;
public
class
Test
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
// String json="{\"key\":\"密钥\",\"content\": {\"mobilePhone\" : \"1302412588\", \"flag\": \"1\"}}\n" +
// " }";
//获取验证码参数
BaseRequest
request
=
new
BaseRequest
();
request
.
setFlag
(
1
);
request
.
setMobile
(
"13024112070"
);
String
string
=
JSONObject
.
toJSONString
(
request
);
System
.
out
.
println
(
string
);
EncryptEntity
encryptEntity
=
new
EncryptEntity
();
encryptEntity
.
setContent
(
string
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
encryptEntity
));
System
.
out
.
println
(
"------------------------------>"
);
//获取注册参数
// BaseRequest register = null;
// register = new BaseRequest();
// register.setMobile("13024112588");
// register.setPassword("qq123456");
// register.setAuthCode("111111");
// String registerString = JSONObject.toJSONString(register);
// System.out.println(registerString);
// EncryptEntity registerEncryptEntity = new EncryptEntity();
// registerEncryptEntity.setContent(registerString);
// System.out.println(JSONObject.toJSONString(registerEncryptEntity));
// System.out.println("------------------------------>");
//
// //修改用户信息接口
// PatientReq req=new PatientReq();
// req.setAddress("测试数据");
// req.setEmail("2586622608@qq.com");
// req.setTelephone("座机号码");
// String json = JSONObject.toJSONString(req);
// System.out.println(json);
// EncryptEntity patientReqEncryptEntity = new EncryptEntity();
// patientReqEncryptEntity.setContent(json);
// System.out.println(JSONObject.toJSONString(patientReqEncryptEntity));
// Doctor doctor = new Doctor();
// doctor.setName("crs");
// doctor.setMobilePhone("13024112222");
// doctor.setPassword("qq123456");
// doctor.setCard("412702195468146814821");
// doctor.setCityName("上海市");
// String doctorJson = JSONObject.toJSONString(doctor);
// System.out.println(doctorJson);
// String mobile = jsonObject.getString("mobile");
// String authCode = jsonObject.getString("authCode");
// String password = jsonObject.getString("password");
// JSONObject jsonObject = new JSONObject();
// jsonObject.put("mobile","13024112565");
// jsonObject.put("authCode","13024112565");
// jsonObject.put("password","qq123456");
// System.out.println(jsonObject.toJSONString());
// System.out.println("--------------------》");
//
//
// EncryptEntity encryptEntity1 = new EncryptEntity();
// encryptEntity1.setContent("content");
// encryptEntity1.setKey("awgvsfgwgv");
// String encryptEntity1Json = JSONObject.toJSONString(encryptEntity1);
// System.out.println(encryptEntity1Json);
System
.
out
.
println
(
"--------------------登录接口-------------"
);
String
publicKey
=
"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCa6j3SJwXr/pLLwb6Pq8pi9StPq+Wvm6vu+LWQB1hNqClWk0jQm5GnF6Kj0ac2gqgsMsutc3hhMaaX2QZvLX+gFQHC/ufGBdBbpPtDeGWsQItsMf/xqqlkLPkc7eVTyfsmrpQM7BG9LVvaPVXPVUcZfJNBaYuR4+Sf6Zi2ayI/hQIDAQAB"
;
BaseRequest
login
=
new
BaseRequest
();
login
.
setMobile
(
"13024112080"
);
login
.
setPassword
(
"D0DCBF0D12A6B1E7FBFA2CE5848F3EFF"
);
String
con
=
JSONObject
.
toJSONString
(
login
);
String
contentResult
=
AESUtil
.
aesEncrypt
(
con
,
"YCPQPx4qpQjEjDea"
);
String
keyResult
=
RSAUtil
.
encrypt
(
"YCPQPx4qpQjEjDea"
,
publicKey
);
EncryptEntity
encryptTest
=
new
EncryptEntity
();
encryptTest
.
setContent
(
contentResult
);
encryptTest
.
setKey
(
keyResult
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
encryptTest
));
System
.
out
.
println
(
"--------------------修改密码接口-------------"
);
BaseRequest
changePwd
=
new
BaseRequest
();
changePwd
.
setOldPwd
(
"D0DCBF0D12A6B1E7FBFA2CE5848F3EFF"
);
changePwd
.
setPassword
(
"0B9A75D6A88721A4BCF94F0FD668C56B"
);
String
changePwdStr
=
JSONObject
.
toJSONString
(
changePwd
);
System
.
out
.
println
(
changePwdStr
);
String
contentResult1
=
AESUtil
.
aesEncrypt
(
changePwdStr
,
"YCPQPx4qpQjEjDea"
);
String
keyResult1
=
RSAUtil
.
encrypt
(
"YCPQPx4qpQjEjDea"
,
publicKey
);
EncryptEntity
encryptTest1
=
new
EncryptEntity
();
encryptTest1
.
setContent
(
contentResult1
);
encryptTest1
.
setKey
(
keyResult1
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
encryptTest1
));
System
.
out
.
println
(
"--------------------获取验证码接口-------------"
);
BaseRequest
authCode
=
new
BaseRequest
();
authCode
.
setFlag
(
1
);
authCode
.
setMobile
(
"13024112081"
);
String
authCodeStr
=
JSONObject
.
toJSONString
(
authCode
);
System
.
out
.
println
(
authCodeStr
);
String
contentResult2
=
AESUtil
.
aesEncrypt
(
authCodeStr
,
"YCPQPx4qpQjEjDea"
);
String
keyResult2
=
RSAUtil
.
encrypt
(
"YCPQPx4qpQjEjDea"
,
publicKey
);
EncryptEntity
encryptTest2
=
new
EncryptEntity
();
encryptTest2
.
setContent
(
contentResult2
);
encryptTest2
.
setKey
(
keyResult2
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
encryptTest2
));
System
.
out
.
println
(
"--------------------注册接口-------------"
);
//获取注册参数
BaseRequest
register
=
null
;
register
=
new
BaseRequest
();
register
.
setMobile
(
"13024112080"
);
register
.
setPassword
(
"D0DCBF0D12A6B1E7FBFA2CE5848F3EFF"
);
register
.
setAuthCode
(
"012082"
);
String
registerString3
=
JSONObject
.
toJSONString
(
register
);
String
contentResult3
=
AESUtil
.
aesEncrypt
(
registerString3
,
"YCPQPx4qpQjEjDea"
);
String
keyResult3
=
RSAUtil
.
encrypt
(
"YCPQPx4qpQjEjDea"
,
publicKey
);
EncryptEntity
encryptTest3
=
new
EncryptEntity
();
encryptTest3
.
setContent
(
contentResult3
);
encryptTest3
.
setKey
(
keyResult3
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
encryptTest3
));
System
.
out
.
println
(
"--------------------一键登录接口-------------"
);
BaseRequest
loginRegister
=
null
;
loginRegister
=
new
BaseRequest
();
loginRegister
.
setMobile
(
"13024112081"
);
loginRegister
.
setAuthCode
(
"393791"
);
String
registerString4
=
JSONObject
.
toJSONString
(
loginRegister
);
String
contentResult4
=
AESUtil
.
aesEncrypt
(
registerString4
,
"YCPQPx4qpQjEjDea"
);
String
keyResult4
=
RSAUtil
.
encrypt
(
"YCPQPx4qpQjEjDea"
,
publicKey
);
EncryptEntity
encryptTest4
=
new
EncryptEntity
();
encryptTest4
.
setContent
(
contentResult4
);
encryptTest4
.
setKey
(
keyResult4
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
encryptTest4
));
}
}
server/src/main/java/com/pica/cloud/account/account/server/constants/Constants.java
浏览文件 @
753091e7
...
@@ -6,11 +6,43 @@ package com.pica.cloud.account.account.server.constants;
...
@@ -6,11 +6,43 @@ package com.pica.cloud.account.account.server.constants;
*/
*/
public
class
Constants
{
public
class
Constants
{
private
Constants
()
{}
private
Constants
()
{
}
public
static
final
String
SEND_MESSAGE
=
"/sms/send"
;
public
static
final
String
SEND_MESSAGE
=
"/sms/send"
;
/** 批量短信url */
/**
* 批量短信url
*/
public
static
final
String
BATCH_SEND_MESSAGE
=
"/sms/send_batch_dif"
;
public
static
final
String
BATCH_SEND_MESSAGE
=
"/sms/send_batch_dif"
;
//token
public
static
final
String
TOKEN
=
"token"
;
//用户id
public
static
final
String
USER_ID
=
"userId"
;
//是否绑定
public
static
final
String
BIND_FLAG
=
"bindFlag"
;
//联合登录id
public
static
final
String
UNION_ID
=
"unionId"
;
//用户是否完善过信息
public
static
final
String
USER_ENTIRE_FLAG
=
"entireFlag"
;
/**
* 请求头信息
*/
public
static
final
String
HEADER_MOBILE
=
"mobile"
;
public
static
final
String
HEADER_USER_TYPE
=
"游客"
;
public
static
final
String
HEADER_BROWSER
=
"browser"
;
public
static
final
String
HEADER_OPERATOR_SYSTEM
=
"os"
;
public
static
final
String
HEADER_TERMINAL_TYPE
=
"terminalType"
;
public
static
final
String
HEADER_SYS_CODE
=
"sysCode"
;
public
static
final
String
HEADER_SYS_SOURCE
=
"app"
;
public
static
final
String
HEADER_GUEST_ID
=
"guest_id"
;
public
static
final
String
HEADER_IP
=
"ip"
;
/**
* 时间格式化
*/
public
static
final
String
TIME_FORMAT
=
"yyyy-MM-dd HH:mm:ss"
;
}
}
server/src/main/java/com/pica/cloud/account/account/server/controller/AccountBaseController.java
浏览文件 @
753091e7
...
@@ -4,6 +4,9 @@ import com.alibaba.fastjson.JSON;
...
@@ -4,6 +4,9 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.pica.cloud.account.account.server.configuration.PropertiesConfiguration
;
import
com.pica.cloud.account.account.server.configuration.PropertiesConfiguration
;
import
com.pica.cloud.account.account.server.constants.Constants
;
import
com.pica.cloud.account.account.server.constants.Constants
;
import
com.pica.cloud.account.account.server.entity.AccountUser
;
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.util.PICAPSendMsgModel
;
import
com.pica.cloud.account.account.server.util.PICAPSendMsgModel
;
import
com.pica.cloud.foundation.entity.PicaException
;
import
com.pica.cloud.foundation.entity.PicaException
;
import
com.pica.cloud.foundation.entity.PicaResultCode
;
import
com.pica.cloud.foundation.entity.PicaResultCode
;
...
@@ -17,10 +20,13 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -17,10 +20,13 @@ import org.apache.commons.lang3.StringUtils;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.*
;
import
java.util.*
;
/**
/**
* controller基类
* controller基类
*
* @author andong
* @author andong
* @create 2019/5/21
* @create 2019/5/21
*/
*/
...
@@ -76,7 +82,7 @@ public abstract class AccountBaseController extends BaseController {
...
@@ -76,7 +82,7 @@ public abstract class AccountBaseController extends BaseController {
try
{
try
{
Map
<
String
,
String
>
data
=
Object2Map
.
objectToMapString
(
"yyyy-MM-dd HH:mm:ss"
,
picaUser
,
new
String
[
0
]);
Map
<
String
,
String
>
data
=
Object2Map
.
objectToMapString
(
"yyyy-MM-dd HH:mm:ss"
,
picaUser
,
new
String
[
0
]);
data
.
put
(
"sysCode"
,
sysCode
);
data
.
put
(
"sysCode"
,
sysCode
);
return
super
.
getRedisClient
().
saveToken
(
data
,
365
*
24
*
3600
);
//token有效期365天
return
super
.
getRedisClient
().
saveToken
(
data
,
365
*
24
*
3600
);
//token有效期365天
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
logger
.
error
(
"保存token失败,doctorId: {}"
,
picaUser
.
getId
());
logger
.
error
(
"保存token失败,doctorId: {}"
,
picaUser
.
getId
());
return
StringUtils
.
EMPTY
;
return
StringUtils
.
EMPTY
;
...
@@ -110,7 +116,6 @@ public abstract class AccountBaseController extends BaseController {
...
@@ -110,7 +116,6 @@ public abstract class AccountBaseController extends BaseController {
picapSendMsgModel
.
setExtend
(
""
);
picapSendMsgModel
.
setExtend
(
""
);
picapSendMsgModel
.
setSupplementFlag
(
true
);
picapSendMsgModel
.
setSupplementFlag
(
true
);
picapSendMsgModel
.
setSms_entity_id
(
0
);
picapSendMsgModel
.
setSms_entity_id
(
0
);
long
currentTimeMillis
=
System
.
currentTimeMillis
();
long
currentTimeMillis
=
System
.
currentTimeMillis
();
picapSendMsgModel
.
setTime
(
String
.
valueOf
(
currentTimeMillis
));
picapSendMsgModel
.
setTime
(
String
.
valueOf
(
currentTimeMillis
));
picapSendMsgModel
.
setKey
(
MD5Util
.
MD5
(
"pica"
+
currentTimeMillis
));
picapSendMsgModel
.
setKey
(
MD5Util
.
MD5
(
"pica"
+
currentTimeMillis
));
...
@@ -125,4 +130,62 @@ public abstract class AccountBaseController extends BaseController {
...
@@ -125,4 +130,62 @@ public abstract class AccountBaseController extends BaseController {
logger
.
error
(
"发送短信失败"
);
logger
.
error
(
"发送短信失败"
);
}
}
}
}
/**
* 账户信息
*
* @return
*/
public
AccountUser
getAccountUser
()
{
//把所有请求头信息都封装到当前模型中
String
token
=
this
.
getToken
();
AccountUser
accountUser
=
super
.
getRedisClient
().
getToken
(
token
,
AccountUser
.
class
);
accountUser
.
setLoginFrom
(
this
.
getSourceType
());
accountUser
.
setLoginPlatform
(
this
.
getProductType
());
accountUser
.
setLoginIp
(
super
.
getIpAddr
());
return
accountUser
;
}
/**
* 获取账户id
*
* @return
*/
public
Integer
getAcctId
()
{
try
{
AccountUser
accountUser
=
getAccountUser
();
return
accountUser
.
getAcctId
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
AccountException
(
AccountExceptionEnum
.
PICA_LOGIN_AGAIN
);
}
}
/**
* 产品线类型:productType: 1.云鹊医(默认值) 2云鹊健康
*
* @return
*/
public
Integer
getProductType
()
{
HttpServletRequest
request
=
super
.
getRequest
();
String
str
=
request
.
getHeader
(
"productType"
);
if
(
StringUtils
.
isNotEmpty
(
str
))
{
return
Integer
.
parseInt
(
str
);
}
return
null
;
}
/**
* 终端来源 sourceType:1.android 2.ios 3.web 4.wechat(例如微信小程序) 5.h5
*
* @return
*/
public
Integer
getSourceType
()
{
HttpServletRequest
request
=
super
.
getRequest
();
String
str
=
request
.
getHeader
(
"sourceType"
);
if
(
StringUtils
.
isNotEmpty
(
str
))
{
return
Integer
.
parseInt
(
str
);
}
return
null
;
}
}
}
server/src/main/java/com/pica/cloud/account/account/server/controller/AccountController.java
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
controller
;
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
controller
;
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.EncryptEntity
;
import
com.pica.cloud.account.account.server.entity.LoginResult
;
import
com.pica.cloud.account.account.server.mapper.AccountMapper
;
import
com.pica.cloud.account.account.server.req.AccountReq
;
import
com.pica.cloud.account.account.server.req.AccountReq
;
import
com.pica.cloud.account.account.server.req.BaseRequest
;
import
com.pica.cloud.account.account.server.service.AccountService
;
import
com.pica.cloud.account.account.server.service.AccountService
;
import
com.pica.cloud.account.account.server.service.CaptchaService
;
import
com.pica.cloud.account.account.server.service.CaptchaService
;
import
com.pica.cloud.account.account.server.util.CryptoUtil
;
import
com.pica.cloud.foundation.encryption.common.constants.EncryptConstants
;
import
com.pica.cloud.foundation.encryption.common.constants.EncryptConstants
;
import
com.pica.cloud.foundation.encryption.util.EncryptUtils
;
import
com.pica.cloud.foundation.encryption.util.EncryptUtils
;
import
com.pica.cloud.foundation.entity.PicaException
;
import
com.pica.cloud.foundation.entity.PicaException
;
...
@@ -46,6 +51,7 @@ public class AccountController extends AccountBaseController {
...
@@ -46,6 +51,7 @@ public class AccountController extends AccountBaseController {
private
AccountService
accountService
;
private
AccountService
accountService
;
@Autowired
@Autowired
private
CaptchaService
captchaService
;
private
CaptchaService
captchaService
;
@Autowired
@Autowired
@Qualifier
(
"cacheMigrateClient"
)
@Qualifier
(
"cacheMigrateClient"
)
private
ICacheClient
redisClient
;
private
ICacheClient
redisClient
;
...
@@ -95,6 +101,7 @@ public class AccountController extends AccountBaseController {
...
@@ -95,6 +101,7 @@ public class AccountController extends AccountBaseController {
return
PicaResponse
.
toResponse
();
return
PicaResponse
.
toResponse
();
}
}
@ApiOperation
(
"微信登录"
)
@ApiOperation
(
"微信登录"
)
@PostMapping
(
"/login/wechat"
)
@PostMapping
(
"/login/wechat"
)
public
PicaResponse
<
String
>
wechatLogin
(
@RequestBody
AccountReq
req
)
{
public
PicaResponse
<
String
>
wechatLogin
(
@RequestBody
AccountReq
req
)
{
...
@@ -148,14 +155,14 @@ public class AccountController extends AccountBaseController {
...
@@ -148,14 +155,14 @@ public class AccountController extends AccountBaseController {
return
PicaResponse
.
toResponse
(
newToken
);
return
PicaResponse
.
toResponse
(
newToken
);
}
}
@ApiOperation
(
"注册"
)
//
@ApiOperation("注册")
@PostMapping
(
"/register"
)
//
@PostMapping("/register")
public
PicaResponse
<
String
>
register
(
@RequestBody
AccountReq
req
)
{
public
PicaResponse
<
LoginResult
>
register
(
@RequestBody
AccountReq
req
)
{
this
.
checkMobilePhone
(
req
.
getMobilePhone
());
this
.
checkMobilePhone
(
req
.
getMobilePhone
());
this
.
checkAuthCode
(
req
);
this
.
checkAuthCode
(
req
);
String
deviceType
=
super
.
getDeviceInfo
(
"device_type"
);
//1:pc 2:android 3:ios
String
deviceType
=
super
.
getDeviceInfo
(
"device_type"
);
//1:pc 2:android 3:ios
Account
account
=
new
Account
();
Account
account
=
new
Account
();
account
.
setMobilePhone
(
req
.
getMobilePhone
(
));
account
.
setMobilePhone
(
EncryptUtils
.
encryptContent
(
req
.
getMobilePhone
(),
EncryptConstants
.
ENCRYPT_TYPE_MOBILE
));
switch
(
deviceType
)
{
//注册来源
switch
(
deviceType
)
{
//注册来源
case
"1"
:
case
"1"
:
account
.
setRegisterSource
(
CommonConstants
.
SYSTEM_TYPE_P024_NO_3
);
//pc
account
.
setRegisterSource
(
CommonConstants
.
SYSTEM_TYPE_P024_NO_3
);
//pc
...
@@ -169,23 +176,39 @@ public class AccountController extends AccountBaseController {
...
@@ -169,23 +176,39 @@ public class AccountController extends AccountBaseController {
default
:
default
:
account
.
setRegisterSource
(
7
);
//H5注册
account
.
setRegisterSource
(
7
);
//H5注册
}
}
accountService
.
createAccount
(
account
);
//创建账号
//创建账号
accountService
.
createAccount
(
account
);
//生成token并返回
//生成token并返回
String
newToken
=
this
.
generateToken
(
account
,
deviceType
);
String
newToken
=
this
.
generateToken
(
account
,
deviceType
);
return
PicaResponse
.
toResponse
(
newToken
);
LoginResult
result
=
new
LoginResult
();
result
.
setToken
(
newToken
);
return
PicaResponse
.
toResponse
(
result
);
}
}
@ApiOperation
(
"登录或注册"
)
@ApiOperation
(
"H5端一键登录功能,无需完善信息"
)
@PostMapping
(
"/login-register"
)
@PostMapping
(
"/login-register/v1"
)
public
PicaResponse
<
String
>
loginRegister
(
@RequestBody
AccountReq
req
)
{
public
PicaResponse
loginRegister
(
@RequestBody
EncryptEntity
entity
)
throws
Exception
{
this
.
checkMobilePhone
(
req
.
getMobilePhone
());
BaseRequest
request
=
CryptoUtil
.
decrypt
(
entity
,
BaseRequest
.
class
);
req
.
setPassword
(
null
);
//登录或注册,只能使用验证码
this
.
checkMobilePhone
(
request
.
getMobile
());
AccountReq
req
=
new
AccountReq
();
req
.
setMobilePhone
(
request
.
getMobile
());
req
.
setPassword
(
null
);
//登录或注册,只能使用验证码
req
.
setAuthCode
(
request
.
getAuthCode
());
req
.
setFlag
(
"0"
);
req
.
setUnionid
(
request
.
getUnionId
());
//判断账号是否已经存在
//判断账号是否已经存在
Account
account
=
accountService
.
getByMobilePhone
(
req
.
getMobilePhone
());
Account
account
=
accountService
.
getByMobilePhone
(
req
.
getMobilePhone
());
if
(
account
!=
null
)
{
if
(
account
!=
null
)
{
return
this
.
login
(
req
);
//登录
PicaResponse
response
=
this
.
login
(
req
);
//登录
if
(
response
.
getData
()
!=
null
)
{
LoginResult
result
=
new
LoginResult
();
result
.
setToken
(
response
.
getData
().
toString
());
return
PicaResponse
.
toResponse
(
result
);
}
return
response
;
}
else
{
}
else
{
return
this
.
register
(
req
);
//注册
return
this
.
register
(
req
);
//注册
}
}
...
@@ -200,6 +223,7 @@ public class AccountController extends AccountBaseController {
...
@@ -200,6 +223,7 @@ public class AccountController extends AccountBaseController {
//获取验证码redis key
//获取验证码redis key
private
String
getAuthCodeKey
(
String
mobilePhone
,
String
flag
)
{
private
String
getAuthCodeKey
(
String
mobilePhone
,
String
flag
)
{
logger
.
info
(
AUTH_CODE_PREFIX
+
flag
+
"-"
+
EncryptUtils
.
encryptContent
(
mobilePhone
,
EncryptConstants
.
ENCRYPT_TYPE_MOBILE
));
return
AUTH_CODE_PREFIX
+
flag
+
"-"
+
EncryptUtils
.
encryptContent
(
mobilePhone
,
EncryptConstants
.
ENCRYPT_TYPE_MOBILE
);
return
AUTH_CODE_PREFIX
+
flag
+
"-"
+
EncryptUtils
.
encryptContent
(
mobilePhone
,
EncryptConstants
.
ENCRYPT_TYPE_MOBILE
);
}
}
...
@@ -212,7 +236,9 @@ public class AccountController extends AccountBaseController {
...
@@ -212,7 +236,9 @@ public class AccountController extends AccountBaseController {
}
}
String
authCodeKey
=
this
.
getAuthCodeKey
(
req
.
getMobilePhone
(),
flag
);
String
authCodeKey
=
this
.
getAuthCodeKey
(
req
.
getMobilePhone
(),
flag
);
logger
.
info
(
authCodeKey
);
String
cacheCode
=
redisClient
.
get
(
authCodeKey
);
//从redis获取验证码
String
cacheCode
=
redisClient
.
get
(
authCodeKey
);
//从redis获取验证码
if
(
StringUtils
.
isBlank
(
cacheCode
))
{
if
(
StringUtils
.
isBlank
(
cacheCode
))
{
throw
new
PicaException
(
PicaResultCode
.
RESULE_DATA_NONE
.
code
(),
"短信验证码已过期,请重新获取"
);
throw
new
PicaException
(
PicaResultCode
.
RESULE_DATA_NONE
.
code
(),
"短信验证码已过期,请重新获取"
);
}
}
...
@@ -279,4 +305,49 @@ public class AccountController extends AccountBaseController {
...
@@ -279,4 +305,49 @@ public class AccountController extends AccountBaseController {
return
newToken
;
return
newToken
;
}
}
/**
* 旧的注册接口,下个版本可以去掉
* @param req
* @return
*/
@ApiOperation
(
"H5端一键登录功能,无需完善信息 旧接口"
)
@PostMapping
(
"/login-register"
)
public
PicaResponse
<
String
>
loginRegister
(
@RequestBody
AccountReq
req
)
{
this
.
checkMobilePhone
(
req
.
getMobilePhone
());
req
.
setPassword
(
null
);
//登录或注册,只能使用验证码
//判断账号是否已经存在
Account
account
=
accountService
.
getByMobilePhone
(
req
.
getMobilePhone
());
if
(
account
!=
null
)
{
return
this
.
login
(
req
);
//登录
}
else
{
return
this
.
registerOld
(
req
);
//注册
}
}
public
PicaResponse
<
String
>
registerOld
(
@RequestBody
AccountReq
req
)
{
this
.
checkMobilePhone
(
req
.
getMobilePhone
());
this
.
checkAuthCode
(
req
);
String
deviceType
=
super
.
getDeviceInfo
(
"device_type"
);
//1:pc 2:android 3:ios
Account
account
=
new
Account
();
account
.
setMobilePhone
(
EncryptUtils
.
encryptContent
(
req
.
getMobilePhone
(),
EncryptConstants
.
ENCRYPT_TYPE_MOBILE
));
switch
(
deviceType
)
{
//注册来源
case
"1"
:
account
.
setRegisterSource
(
CommonConstants
.
SYSTEM_TYPE_P024_NO_3
);
//pc
break
;
case
"2"
:
account
.
setRegisterSource
(
CommonConstants
.
SYSTEM_TYPE_P024_NO_1
);
//android
break
;
case
"3"
:
account
.
setRegisterSource
(
CommonConstants
.
SYSTEM_TYPE_P024_NO_2
);
//ios
break
;
default
:
account
.
setRegisterSource
(
7
);
//H5注册
}
//创建账号
accountService
.
createAccount
(
account
);
//生成token并返回
String
newToken
=
this
.
generateToken
(
account
,
deviceType
);
return
PicaResponse
.
toResponse
(
newToken
);
}
}
}
server/src/main/java/com/pica/cloud/account/account/server/controller/AutoCodeController.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
controller
;
import
com.pica.cloud.account.account.server.entity.Account
;
import
com.pica.cloud.account.account.server.entity.AccountInfoEntity
;
import
com.pica.cloud.account.account.server.entity.AccountUnionEntity
;
import
com.pica.cloud.account.account.server.entity.EncryptEntity
;
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.AccountInfoDetailMapper
;
import
com.pica.cloud.account.account.server.req.BaseRequest
;
import
com.pica.cloud.account.account.server.service.AccountService
;
import
com.pica.cloud.account.account.server.service.AccountUnionService
;
import
com.pica.cloud.account.account.server.service.CaptchaService
;
import
com.pica.cloud.account.account.server.util.AESUtil
;
import
com.pica.cloud.account.account.server.util.AccountUtils
;
import
com.pica.cloud.account.account.server.util.CryptoUtil
;
import
com.pica.cloud.foundation.entity.PicaException
;
import
com.pica.cloud.foundation.entity.PicaResponse
;
import
com.pica.cloud.foundation.entity.PicaResultCode
;
import
com.pica.cloud.foundation.redis.ICacheClient
;
import
com.pica.cloud.foundation.utils.utils.CommonUtil
;
import
com.pica.cloud.foundation.utils.utils.ValidateUtils
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
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
=
"短信验证码资源"
)
@RestController
public
class
AutoCodeController
extends
AccountBaseController
{
private
final
String
AUTH_CODE_PREFIX
=
"authCode-"
;
private
Logger
logger
=
LoggerFactory
.
getLogger
(
AccountController
.
class
);
@Autowired
private
AccountInfoDetailMapper
accountInfoDetailMapper
;
@Autowired
private
AccountUnionService
accountUnionService
;
@Autowired
private
CaptchaService
captchaService
;
@Autowired
private
AccountService
accountService
;
@Autowired
@Qualifier
(
"cacheMigrateClient"
)
private
ICacheClient
cacheClient
;
@ApiOperation
(
"获取短信验证码,无需图形验证码,如app端"
)
@PostMapping
(
value
=
"/authCode"
)
public
PicaResponse
getAuthCode
(
@RequestBody
EncryptEntity
entity
)
throws
Exception
{
BaseRequest
request
=
CryptoUtil
.
decrypt
(
entity
,
BaseRequest
.
class
);
AccountUtils
.
checkMobilePhone
(
request
.
getMobile
());
processSysCode
(
request
.
getMobile
(),
request
.
getFlag
());
return
PicaResponse
.
toResponse
();
}
@ApiOperation
(
"获取短信验证码,需要图形验证码,如H5端和PC端;验证码类型 0默认 1注册 2微信登录绑定手机 3修改手机 4重置密码 5忘记密码 7患者招募提交问卷(效验)"
)
@PostMapping
(
"/account/authCode"
)
public
PicaResponse
<
String
>
getAuthCodeWithCaptcha
(
@RequestBody
EncryptEntity
entity
)
throws
Exception
{
BaseRequest
request
=
CryptoUtil
.
decrypt
(
entity
,
BaseRequest
.
class
);
String
mobilePhone
=
request
.
getMobile
();
String
flag
=
request
.
getFlag
()
+
""
;
String
captchaToken
=
request
.
getCaptchaToken
();
String
captchaAnswer
=
request
.
getCaptchaAnswer
();
//校验图形验证码
if
(!
captchaService
.
acknowledge
(
captchaToken
,
captchaAnswer
))
{
return
PicaResponse
.
toResponse
(
null
,
PicaResultCode
.
PARAM_IS_INVALID
.
code
(),
"图形验证码错误"
);
}
this
.
checkMobilePhone
(
mobilePhone
);
String
authCode
=
CommonUtil
.
createValidateCode
();
//随机生成验证码
String
message
=
"您的验证码是"
+
authCode
+
",在10分钟内有效。如非本人操作,请忽略本短信!"
;
//判断账号是否已经存在
Account
account
=
accountService
.
getByMobilePhone
(
mobilePhone
);
long
senderId
=
account
==
null
?
0L
:
account
.
getId
();
//验证码保存到redis,失效时间10分钟
cacheClient
.
set
(
this
.
getAuthCodeKey
(
mobilePhone
,
flag
),
authCode
,
600
);
logger
.
info
(
this
.
getAuthCodeKey
(
mobilePhone
,
flag
));
//发送短信
super
.
sendMobileMessage
(
mobilePhone
,
message
,
senderId
);
return
PicaResponse
.
toResponse
(
StringUtils
.
EMPTY
);
}
@ApiOperation
(
"微信获取验证码"
)
@PostMapping
(
value
=
"/authCode/wechat"
)
public
PicaResponse
getWChatSysCode
(
@RequestBody
EncryptEntity
entity
)
throws
Exception
{
BaseRequest
request
=
CryptoUtil
.
decrypt
(
entity
,
BaseRequest
.
class
);
request
.
setFlag
(
AccountTypeEnum
.
SYSCODE_TYPE_WE_CHAT
.
getCode
());
AccountUtils
.
checkMobilePhone
(
request
.
getMobile
());
AccountUnionEntity
accountUnionEntity
=
accountUnionService
.
selectInfoByUnionId
(
request
.
getUnionId
());
if
(
accountUnionEntity
!=
null
)
{
processSysCode
(
request
.
getMobile
(),
request
.
getFlag
());
return
PicaResponse
.
toResponse
();
}
throw
new
AccountException
(
AccountExceptionEnum
.
PICA_UNBIND_MOBILE
);
}
/**
* 验证码发送逻辑
* 1)随机数生成验证码;
* 2)验证码失效时间十分钟;
* 3)同一个业务一个手机号一分钟只能发送一次:提示:请X秒后重试.(用手机号区别用户,用flag区别业务类型)
*
* @param mobilePhone
* @param flag
*/
private
void
processSysCode
(
String
mobilePhone
,
Integer
flag
)
{
String
authCodeKey
=
this
.
getAuthCodeKey
(
mobilePhone
,
flag
.
toString
());
String
authCodeKeySecure
=
authCodeKey
+
"-secure"
;
//如果存在,说明刚刚发送过验证码
if
(
cacheClient
.
exists
(
authCodeKey
))
{
Long
time
=
cacheClient
.
get
(
this
.
getAuthCodeKey
(
mobilePhone
,
flag
.
toString
())
+
"-secure"
,
Long
.
class
);
if
(
time
==
null
)
{
processSendAuthCode
(
mobilePhone
,
flag
,
authCodeKeySecure
);
}
else
{
int
remainTime
=
59
-
(
int
)
(
System
.
currentTimeMillis
()
-
time
)
/
1000
;
if
(
remainTime
>
0
)
{
throw
new
AccountException
(
AccountExceptionEnum
.
PICA_SYSCODE_RETRY
.
getCode
(),
AccountExceptionEnum
.
PICA_SYSCODE_RETRY
.
getMessage
().
replace
(
"X"
,
String
.
valueOf
(
remainTime
)));
}
else
{
processSendAuthCode
(
mobilePhone
,
flag
,
authCodeKeySecure
);
}
}
}
else
{
processSendAuthCode
(
mobilePhone
,
flag
,
authCodeKeySecure
);
}
}
/**
* 调用发送验证码的接口
*
* @param mobilePhone
* @param flag
* @param authCodeKeySecure
*/
private
void
processSendAuthCode
(
String
mobilePhone
,
Integer
flag
,
String
authCodeKeySecure
)
{
String
authCode
=
CommonUtil
.
createValidateCode
();
String
message
=
"您的验证码是"
+
authCode
+
",在10分钟内有效。如非本人操作,请忽略本短信!"
;
AccountInfoEntity
accountInfoEntity
=
accountInfoDetailMapper
.
selectByMobile
(
mobilePhone
);
long
senderId
=
accountInfoEntity
==
null
?
0L
:
accountInfoEntity
.
getId
();
cacheClient
.
set
(
this
.
getAuthCodeKey
(
mobilePhone
,
flag
.
toString
()),
authCode
,
600
);
cacheClient
.
set
(
authCodeKeySecure
,
System
.
currentTimeMillis
(),
60
);
super
.
sendMobileMessage
(
mobilePhone
,
message
,
senderId
);
}
//获取验证码redis key
private
String
getAuthCodeKey
(
String
mobilePhone
,
String
flag
)
{
return
AUTH_CODE_PREFIX
+
flag
+
"-"
+
AESUtil
.
encryptV0
(
mobilePhone
);
}
//手机格式校验
private
void
checkMobilePhone
(
String
mobilePhone
)
{
if
(
StringUtils
.
isBlank
(
mobilePhone
)
||
!
ValidateUtils
.
isMobile
(
mobilePhone
))
{
throw
new
PicaException
(
PicaResultCode
.
PARAM_IS_INVALID
.
code
(),
"请输入正确的手机号"
);
}
}
}
server/src/main/java/com/pica/cloud/account/account/server/controller/CipherController.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
controller
;
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.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* Created on 2019/9/16 15:29
* author:crs
* Description:H5端获取公钥资源
*/
@Api
(
description
=
"密钥接口资源"
)
@RestController
public
class
CipherController
{
@Value
(
"${rsapublickey}"
)
private
String
rsaPublicKey
;
@ApiOperation
(
"获取公钥Key接口"
)
@GetMapping
(
value
=
"/cipher/key"
)
public
PicaResponse
<
String
>
getPublicKey
()
{
return
PicaResponse
.
toResponse
(
rsaPublicKey
);
}
}
server/src/main/java/com/pica/cloud/account/account/server/controller/DoctorController.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
controller
;
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.service.DoctorService
;
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.PicaResponse
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
/**
* Created on 2019/9/10 18:51
* author:crs
* Description:云鹊医 获取用户信息资源
*/
@Api
(
description
=
"云鹊医用户信息信息资源"
)
@RestController
@RequestMapping
(
"/doctor"
)
public
class
DoctorController
extends
AccountBaseController
{
@Autowired
private
DoctorService
doctorService
;
@ApiOperation
(
"获取医生信息用接口"
)
@GetMapping
(
value
=
"/info"
,
produces
=
"application/json;charset=utf-8"
)
public
PicaResponse
<
Doctor
>
getDoctorInfo
()
{
AccountUser
accountUser
=
null
;
try
{
accountUser
=
super
.
getAccountUser
();
}
catch
(
Exception
e
)
{
throw
new
AccountException
(
AccountExceptionEnum
.
PICA_LOGIN_AGAIN
);
}
Integer
userId
=
accountUser
.
getId
();
Doctor
doctorInfo
=
doctorService
.
getDoctorInfo
(
userId
);
String
mobilePhone
=
doctorInfo
.
getMobilePhone
();
String
dencrypt
=
EncryptUtils
.
decryptContent
(
mobilePhone
,
EncryptConstants
.
ENCRYPT_TYPE_MOBILE
,
super
.
getToken
());
mobilePhone
=
dencrypt
.
substring
(
0
,
3
)
+
"****"
+
dencrypt
.
substring
(
7
,
11
);
doctorInfo
.
setMobilePhone
(
mobilePhone
);
return
PicaResponse
.
toResponse
(
doctorInfo
);
}
@ApiOperation
(
"修改医生信息接口"
)
@PutMapping
(
value
=
"/info"
,
produces
=
"application/json;charset=utf-8"
)
public
PicaResponse
modifyDoctorInfo
(
@RequestBody
Doctor
doctor
)
{
doctorService
.
modifyDoctorInfo
(
doctor
);
return
PicaResponse
.
toResponse
();
}
/**
* 当前医生是哪个admin账户添加的
*
* @param doctor
* @return
*/
@ApiOperation
(
"客服系统新增医生"
)
@PostMapping
(
value
=
"/info"
,
produces
=
"application/json;charset=utf-8"
)
public
PicaResponse
addDoctorInfo
(
@RequestBody
Doctor
doctor
)
{
if
(
doctor
!=
null
&&
doctor
.
getMobilePhone
()
!=
null
)
{
AccountUtils
.
checkMobilePhone
(
doctor
.
getMobilePhone
());
AccountUtils
.
checkPassword
(
doctor
.
getPassword
());
Integer
userId
=
doctorService
.
addDoctorInfo
(
doctor
);
return
PicaResponse
.
toResponse
(
userId
);
}
else
{
throw
new
AccountException
(
AccountExceptionEnum
.
PICA_PARAMS_ERROR
);
}
}
}
server/src/main/java/com/pica/cloud/account/account/server/controller/LoginController.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
controller
;
import
com.pica.cloud.account.account.server.entity.*
;
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.log.AccountLogEntityUtils
;
import
com.pica.cloud.account.account.server.log.AccountLogUtils
;
import
com.pica.cloud.account.account.server.req.BaseRequest
;
import
com.pica.cloud.account.account.server.service.LoginService
;
import
com.pica.cloud.account.account.server.service.TokenService
;
import
com.pica.cloud.account.account.server.util.AccountUtils
;
import
com.pica.cloud.account.account.server.util.CryptoUtil
;
import
com.pica.cloud.foundation.entity.PicaResponse
;
import
com.pica.cloud.foundation.redis.ICacheClient
;
import
com.pica.cloud.foundation.utils.utils.CommonUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.Map
;
@Api
(
description
=
"登录资源"
)
@RestController
public
class
LoginController
extends
AccountBaseController
{
@Autowired
private
LoginService
loginService
;
@Autowired
@Qualifier
(
"cacheMigrateClient"
)
private
ICacheClient
redisClient
;
@Autowired
private
AccountLogUtils
picaLogUtils
;
@Autowired
private
AccountUtils
accountUtils
;
@Autowired
private
TokenService
tokenService
;
/**
* 密码登录接口
*
* @param entity
* @return
* @throws Exception
*/
@ApiOperation
(
"密码登录接口"
)
@PostMapping
(
"/login"
)
public
PicaResponse
<
LoginResult
>
loginByPassword
(
@RequestBody
EncryptEntity
entity
)
throws
Exception
{
BaseRequest
request
=
CryptoUtil
.
decrypt
(
entity
,
BaseRequest
.
class
);
request
.
setProductType
(
super
.
getProductType
());
request
.
setSourceType
(
super
.
getSourceType
());
request
.
setLoginIp
(
super
.
getIpAddr
());
AccountUtils
.
checkMobilePhone
(
request
.
getMobile
());
AccountUtils
.
checkPassword
(
request
.
getPassword
());
LoginResult
login
=
loginService
.
login
(
request
);
return
PicaResponse
.
toResponse
(
login
);
}
/**
* 一键登录
*
* @param entity
* @return
* @throws Exception
*/
@ApiOperation
(
"PC,App端一键登录接口,需要完善信息"
)
@PostMapping
(
value
=
"/login-register"
)
public
PicaResponse
<
LoginResult
>
loginAndRegister
(
@RequestBody
EncryptEntity
entity
)
throws
Exception
{
BaseRequest
request
=
CryptoUtil
.
decrypt
(
entity
,
BaseRequest
.
class
);
accountUtils
.
checkMobilePhoneAndAuthCode
(
request
.
getMobile
(),
AccountTypeEnum
.
SYSCODE_TYPE_LOGIN
.
getCode
()
+
""
,
request
.
getAuthCode
());
request
.
setProductType
(
super
.
getProductType
());
request
.
setSourceType
(
super
.
getSourceType
());
request
.
setLoginIp
(
super
.
getIpAddr
());
LoginResult
login
=
loginService
.
loginAndRegister
(
request
);
return
PicaResponse
.
toResponse
(
login
);
}
@ApiOperation
(
"微信登录接口"
)
@PostMapping
(
value
=
"/login/wechat"
)
public
PicaResponse
<
LoginResult
>
loginByWeChat
(
@RequestBody
EncryptEntity
entity
)
throws
Exception
{
BaseRequest
request
=
CryptoUtil
.
decrypt
(
entity
,
BaseRequest
.
class
);
request
.
setProductType
(
super
.
getProductType
());
request
.
setSourceType
(
super
.
getSourceType
());
request
.
setLoginIp
(
super
.
getIpAddr
());
LoginResult
result
=
loginService
.
loginByWeChat
(
request
);
return
PicaResponse
.
toResponse
(
result
);
}
@ApiOperation
(
"微信登录第二步接口"
)
@PostMapping
(
value
=
"/login/wechat/step2"
)
public
PicaResponse
<
LoginResult
>
loginByWeChatStep
(
@RequestBody
EncryptEntity
entity
)
throws
Exception
{
BaseRequest
request
=
CryptoUtil
.
decrypt
(
entity
,
BaseRequest
.
class
);
accountUtils
.
checkMobilePhoneAndAuthCode
(
request
.
getMobile
(),
AccountTypeEnum
.
SYSCODE_TYPE_WE_CHAT
.
getCode
()
+
""
,
request
.
getAuthCode
());
request
.
setProductType
(
super
.
getProductType
());
request
.
setSourceType
(
super
.
getSourceType
());
request
.
setLoginIp
(
super
.
getIpAddr
());
LoginResult
result
=
loginService
.
loginByWeChatStep
(
request
);
return
PicaResponse
.
toResponse
(
result
);
}
/**
* 绑定微信接口
*
* @param entity
* @return
* @throws Exception
*/
@ApiOperation
(
"绑定微信接口"
)
@PostMapping
(
"/login/wechat/bind"
)
public
PicaResponse
bindWeChat
(
@RequestBody
EncryptEntity
entity
)
throws
Exception
{
BaseRequest
request
=
CryptoUtil
.
decrypt
(
entity
,
BaseRequest
.
class
);
request
.
setAccId
(
super
.
getAcctId
());
loginService
.
bindWeChat
(
request
);
return
PicaResponse
.
toResponse
();
}
@ApiOperation
(
"微信解除绑定接口"
)
@PutMapping
(
"/login/wechat/unbind"
)
public
PicaResponse
unbindWeChat
()
{
Integer
acctId
=
super
.
getAcctId
();
loginService
.
unbindWeChat
(
acctId
);
return
PicaResponse
.
toResponse
();
}
/**
* 退出登录接口,返回一个随机token
* 1)登录状态调用,2)清除token
*
* @return
*/
@ApiOperation
(
value
=
"退出登录接口"
)
@GetMapping
(
"/logout"
)
public
PicaResponse
<
String
>
loginOut
()
{
String
token
=
super
.
getToken
();
if
(
StringUtils
.
isNotEmpty
(
token
))
{
Integer
acctId
=
super
.
getAcctId
();
redisClient
.
deleteToken
(
token
);
Map
<
String
,
Object
>
headersMap
=
super
.
getHeaders
();
String
newToken
=
tokenService
.
getToken
(
headersMap
);
LogLoginEntity
entity
=
AccountLogEntityUtils
.
getLogLoginEntity
(
acctId
,
super
.
getProductType
(),
super
.
getSourceType
(),
AccountTypeEnum
.
LOGIN_OUT
.
getCode
(),
super
.
getIpAddr
(),
AccountTypeEnum
.
LOGIN_STATUS_SUCCESS
.
getCode
(),
AccountTypeEnum
.
LOG_TYPE_LOGIN
.
getCode
());
picaLogUtils
.
info
(
entity
);
return
PicaResponse
.
toResponse
(
newToken
);
}
else
{
throw
new
AccountException
(
AccountExceptionEnum
.
PICA_LOGIN_AGAIN
);
}
}
@ApiOperation
(
value
=
"web登录获取用户信息"
)
@GetMapping
(
"/login/web"
)
public
PicaResponse
<
LoginResultWeb
>
getLoginResult
()
{
LoginResultWeb
resultWeb
=
new
LoginResultWeb
();
long
doctorId
=
super
.
getDoctorIdByToken
();
if
(
doctorId
<=
0
)
{
resultWeb
.
setIsExist
(
2
);
return
PicaResponse
.
toResponse
(
resultWeb
);
}
PICAPDoctor
doctor
=
loginService
.
queryDoctor
(
doctorId
);
resultWeb
.
setPicapDoctor
(
doctor
);
if
(
doctor
.
getStatus
()
!=
null
)
{
resultWeb
.
setCertifyDoc
(
doctor
.
getStatus
().
intValue
());
}
return
PicaResponse
.
toResponse
(
resultWeb
);
}
}
server/src/main/java/com/pica/cloud/account/account/server/controller/ModifyMobileController.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
controller
;
import
com.pica.cloud.account.account.server.entity.EncryptEntity
;
import
com.pica.cloud.account.account.server.enums.AccountTypeEnum
;
import
com.pica.cloud.account.account.server.req.BaseRequest
;
import
com.pica.cloud.account.account.server.service.ModifyMobileService
;
import
com.pica.cloud.account.account.server.util.AccountUtils
;
import
com.pica.cloud.account.account.server.util.CryptoUtil
;
import
com.pica.cloud.foundation.entity.PicaResponse
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
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.RestController
;
@Api
(
description
=
"修改手机号资源"
)
@RestController
public
class
ModifyMobileController
extends
AccountBaseController
{
@Autowired
private
AccountUtils
accountUtils
;
@Autowired
private
ModifyMobileService
modifyMobileService
;
@ApiOperation
(
"修改手机号"
)
@PostMapping
(
"/mobile/modify"
)
public
PicaResponse
modifyMobile
(
@RequestBody
EncryptEntity
entity
)
throws
Exception
{
Integer
acctId
=
super
.
getAcctId
();
BaseRequest
request
=
CryptoUtil
.
decrypt
(
entity
,
BaseRequest
.
class
);
String
mobile
=
request
.
getMobile
();
accountUtils
.
checkMobilePhoneAndAuthCode
(
mobile
,
AccountTypeEnum
.
SYSCODE_TYPE_MODIFY_MOBILE
.
getCode
()
+
""
,
request
.
getAuthCode
());
modifyMobileService
.
modify
(
acctId
,
mobile
);
return
PicaResponse
.
toResponse
();
}
}
server/src/main/java/com/pica/cloud/account/account/server/controller/PasswordController.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
controller
;
import
com.pica.cloud.account.account.server.entity.EncryptEntity
;
import
com.pica.cloud.account.account.server.enums.AccountTypeEnum
;
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.BaseRequest
;
import
com.pica.cloud.account.account.server.service.PasswordService
;
import
com.pica.cloud.account.account.server.util.AccountUtils
;
import
com.pica.cloud.account.account.server.util.CryptoUtil
;
import
com.pica.cloud.foundation.entity.PicaResponse
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
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
=
"密码资源"
)
@RestController
@RequestMapping
(
"/password"
)
public
class
PasswordController
extends
AccountBaseController
{
@Autowired
private
PasswordService
passwordService
;
@Autowired
private
AccountUtils
accountUtils
;
/**
* 修改密码
*
* @return
*/
@ApiOperation
(
"修改密码接口"
)
@PostMapping
(
value
=
"/modify"
)
public
PicaResponse
modifyPassword
(
@RequestBody
EncryptEntity
entity
)
throws
Exception
{
Integer
acctId
=
super
.
getAcctId
();
BaseRequest
request
=
CryptoUtil
.
decrypt
(
entity
,
BaseRequest
.
class
);
String
oldPwd
=
request
.
getOldPwd
();
String
password
=
request
.
getPassword
();
if
(!
StringUtils
.
isEmpty
(
password
)
&&
!
StringUtils
.
isEmpty
(
oldPwd
))
{
if
(!
password
.
equals
(
oldPwd
))
{
passwordService
.
modifyPassword
(
acctId
,
oldPwd
,
password
);
return
PicaResponse
.
toResponse
();
}
else
{
throw
new
AccountException
(
AccountExceptionEnum
.
PICA_PASSWORD_EQUAL
);
}
}
else
{
throw
new
AccountException
(
AccountExceptionEnum
.
PICA_PASSWORD_NULL
);
}
}
/**
* 忘记密码
*
* @return
*/
@ApiOperation
(
"忘记密码接口"
)
@PostMapping
(
value
=
"/reset"
)
public
PicaResponse
forgetPassword
(
@RequestBody
EncryptEntity
entity
)
throws
Exception
{
BaseRequest
request
=
CryptoUtil
.
decrypt
(
entity
,
BaseRequest
.
class
);
accountUtils
.
checkMobilePhoneAndAuthCode
(
request
.
getMobile
(),
AccountTypeEnum
.
SYSCODE_TYPE_RESET_PASSWORD
.
getCode
()
+
""
,
request
.
getAuthCode
());
if
(
StringUtils
.
isEmpty
(
request
.
getPassword
()))
{
throw
new
AccountException
(
AccountExceptionEnum
.
PICA_PASSWORD_ERROR
);
}
passwordService
.
forgetPassword
(
request
);
return
PicaResponse
.
toResponse
();
}
}
server/src/main/java/com/pica/cloud/account/account/server/controller/PatientInfoController.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
controller
;
import
com.pica.cloud.account.account.server.entity.AccountPatientInfoEntity
;
import
com.pica.cloud.account.account.server.entity.AccountUser
;
import
com.pica.cloud.account.account.server.entity.EncryptEntity
;
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.req.PatientReq
;
import
com.pica.cloud.account.account.server.service.PatientInfoService
;
import
com.pica.cloud.account.account.server.util.AccountUtils
;
import
com.pica.cloud.account.account.server.util.CryptoUtil
;
import
com.pica.cloud.foundation.entity.PicaResponse
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
@Api
(
description
=
"云鹊健康用户信息资源"
)
@RestController
@RequestMapping
(
value
=
"/patient"
)
public
class
PatientInfoController
extends
AccountBaseController
{
@Autowired
private
PatientInfoService
patientInfoService
;
/**
* 获取用户信息接口,产品线不同,用户信息不同(云鹊医,云鹊健康)
*
* @return
*/
@ApiOperation
(
"获取居民信息"
)
@GetMapping
(
value
=
"/info"
,
produces
=
"application/json;charset=utf-8"
)
public
PicaResponse
getUserInfo
()
{
AccountUser
accountUser
=
super
.
getAccountUser
();
AccountPatientInfoEntity
userInfo
=
null
;
Integer
loginFrom
=
accountUser
.
getLoginFrom
();
Integer
userId
=
accountUser
.
getId
();
if
(
loginFrom
==
2
)
{
userInfo
=
patientInfoService
.
getUserInfo
(
userId
);
}
return
PicaResponse
.
toResponse
(
userInfo
);
}
/**
* 修改用户信息接口
*
* @return
*/
@ApiOperation
(
"修改居民信息"
)
@PutMapping
(
value
=
"/info"
,
produces
=
"application/json;charset=utf-8"
)
public
PicaResponse
putUserInfo
(
@RequestBody
EncryptEntity
entity
)
throws
Exception
{
Integer
id
=
super
.
getAccountUser
().
getId
();
PatientReq
request
=
CryptoUtil
.
decrypt
(
entity
,
PatientReq
.
class
);
request
.
setId
(
id
);
request
.
setAcctId
(
super
.
getAcctId
());
AccountPatientInfoEntity
accountPatientInfoEntity
=
new
AccountPatientInfoEntity
();
BeanUtils
.
copyProperties
(
accountPatientInfoEntity
,
request
);
patientInfoService
.
updateUserInfo
(
accountPatientInfoEntity
);
return
PicaResponse
.
toResponse
();
}
@ApiOperation
(
"客服系统添加居民信息"
)
@PostMapping
(
value
=
"/info"
,
produces
=
"application/json;charset=utf-8"
)
public
PicaResponse
addPatientInfo
(
AccountPatientInfoEntity
entity
)
{
Integer
userId
=
super
.
getAccountUser
().
getId
();
AccountUtils
.
checkMobilePhone
(
entity
.
getMobilePhone
());
if
(
StringUtils
.
isBlank
(
entity
.
getName
()))
{
patientInfoService
.
addPatientInfo
(
entity
,
userId
);
}
else
{
throw
new
AccountException
(
AccountExceptionEnum
.
PICA_PARAMS_ERROR
);
}
return
PicaResponse
.
toResponse
();
}
}
server/src/main/java/com/pica/cloud/account/account/server/controller/RegisterController.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
controller
;
import
com.pica.cloud.account.account.server.entity.EncryptEntity
;
import
com.pica.cloud.account.account.server.entity.LoginResult
;
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.req.BaseRequest
;
import
com.pica.cloud.account.account.common.req.OCINRequest
;
import
com.pica.cloud.account.account.server.service.RegisterService
;
import
com.pica.cloud.account.account.server.util.AccountUtils
;
import
com.pica.cloud.account.account.server.util.CryptoUtil
;
import
com.pica.cloud.foundation.entity.PicaException
;
import
com.pica.cloud.foundation.entity.PicaResponse
;
import
com.pica.cloud.foundation.redis.ICacheClient
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
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
=
"注册资源"
)
@RestController
@RequestMapping
(
"/register"
)
public
class
RegisterController
extends
AccountBaseController
{
private
final
String
REPEAT_REGISTER_PREFIX
=
"repeat-register—"
;
@Autowired
private
RegisterService
registerService
;
@Autowired
private
AccountUtils
accountUtils
;
@Autowired
@Qualifier
(
"cacheMigrateClient"
)
private
ICacheClient
redisClient
;
@ApiOperation
(
"PC端,移动端注册接口"
)
@PostMapping
(
value
=
""
)
public
PicaResponse
<
LoginResult
>
register
(
@RequestBody
EncryptEntity
entity
)
throws
Exception
{
BaseRequest
request
=
CryptoUtil
.
decrypt
(
entity
,
BaseRequest
.
class
);
String
mobile
=
request
.
getMobile
();
//接口幂等性处理(redis中没有就进行注册逻辑,如果已经存在,就不处理)
String
exist
=
redisClient
.
get
(
REPEAT_REGISTER_PREFIX
+
mobile
);
if
(
StringUtils
.
isBlank
(
exist
))
{
accountUtils
.
checkMobilePhoneAndAuthCode
(
mobile
,
AccountTypeEnum
.
SYSCODE_TYPE_REGISTER
.
getCode
()
+
""
,
request
.
getAuthCode
());
accountUtils
.
checkPassword
(
request
.
getPassword
());
redisClient
.
set
(
REPEAT_REGISTER_PREFIX
+
mobile
,
mobile
,
30
);
LoginResult
result
=
null
;
try
{
request
.
setFlag
(
AccountTypeEnum
.
SYSCODE_TYPE_REGISTER
.
getCode
());
request
.
setProductType
(
super
.
getProductType
());
request
.
setSourceType
(
super
.
getSourceType
());
request
.
setLoginIp
(
super
.
getIpAddr
());
result
=
registerService
.
register
(
request
);
}
catch
(
Exception
e
)
{
//向上抛出异常,让异常处理框架捕获到
throw
new
AccountException
(
AccountExceptionEnum
.
PICA_REGISTER_FAIL
);
}
finally
{
//如果在注册过程中抛出异常,就删除redis中的注册标记
redisClient
.
del
(
REPEAT_REGISTER_PREFIX
+
mobile
);
}
redisClient
.
del
(
REPEAT_REGISTER_PREFIX
+
mobile
);
return
PicaResponse
.
toResponse
(
result
);
}
else
{
return
PicaResponse
.
toResponse
(
null
,
AccountExceptionEnum
.
PICA_ALREADY_REGISTER
.
getCode
(),
"正在注册中,请勿重复提交"
);
}
}
//"sourceType":6 表示长海项目
@ApiOperation
(
"OCIN项目"
)
@PostMapping
(
value
=
"/ocin"
)
public
PicaResponse
register
(
@RequestBody
OCINRequest
ocinRequest
)
{
registerService
.
ocinRegister
(
ocinRequest
);
return
PicaResponse
.
toResponse
();
}
}
server/src/main/java/com/pica/cloud/account/account/server/controller/TokenController.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
controller
;
import
com.pica.cloud.account.account.server.service.TokenService
;
import
com.pica.cloud.foundation.entity.PicaResponse
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Map
;
/**
* Created on 2019/9/10 9:35
* author:crs
* Description:获取随机token
*/
@Api
(
description
=
"获取游客token"
)
@RestController
public
class
TokenController
extends
AccountBaseController
{
@Autowired
private
TokenService
tokenService
;
@ApiOperation
(
value
=
"获取token接口"
)
@GetMapping
(
value
=
"/token"
)
public
PicaResponse
<
String
>
getRandomToken
()
{
Map
<
String
,
Object
>
headersMap
=
super
.
getHeaders
();
String
token
=
tokenService
.
getToken
(
headersMap
);
return
PicaResponse
.
toResponse
(
token
);
}
}
server/src/main/java/com/pica/cloud/account/account/server/entity/Account.java
浏览文件 @
753091e7
...
@@ -13,6 +13,8 @@ public class Account {
...
@@ -13,6 +13,8 @@ public class Account {
private
Long
id
;
private
Long
id
;
private
Integer
acctId
;
private
Integer
sex
;
private
Integer
sex
;
private
String
name
;
private
String
name
;
...
@@ -75,6 +77,14 @@ public class Account {
...
@@ -75,6 +77,14 @@ public class Account {
this
.
id
=
id
;
this
.
id
=
id
;
}
}
public
Integer
getAcctId
()
{
return
acctId
;
}
public
void
setAcctId
(
Integer
acctId
)
{
this
.
acctId
=
acctId
;
}
public
Integer
getSex
()
{
public
Integer
getSex
()
{
return
sex
;
return
sex
;
}
}
...
...
server/src/main/java/com/pica/cloud/account/account/server/entity/AccountInfoEntity.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
entity
;
import
java.util.Date
;
public
class
AccountInfoEntity
{
private
Integer
id
;
private
String
mobilePhone
;
private
String
password
;
private
Integer
registerProduct
;
private
Integer
registerSource
;
private
String
name
;
private
Integer
age
;
private
Date
birthday
;
private
Integer
sex
;
private
String
idCard
;
private
Date
regTime
;
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
String
getMobilePhone
()
{
return
mobilePhone
;
}
public
void
setMobilePhone
(
String
mobilePhone
)
{
this
.
mobilePhone
=
mobilePhone
;
}
public
String
getPassword
()
{
return
password
;
}
public
void
setPassword
(
String
password
)
{
this
.
password
=
password
;
}
public
Integer
getRegisterProduct
()
{
return
registerProduct
;
}
public
void
setRegisterProduct
(
Integer
registerProduct
)
{
this
.
registerProduct
=
registerProduct
;
}
public
Integer
getRegisterSource
()
{
return
registerSource
;
}
public
void
setRegisterSource
(
Integer
registerSource
)
{
this
.
registerSource
=
registerSource
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
Integer
getAge
()
{
return
age
;
}
public
void
setAge
(
Integer
age
)
{
this
.
age
=
age
;
}
public
Date
getBirthday
()
{
return
birthday
;
}
public
void
setBirthday
(
Date
birthday
)
{
this
.
birthday
=
birthday
;
}
public
Integer
getSex
()
{
return
sex
;
}
public
void
setSex
(
Integer
sex
)
{
this
.
sex
=
sex
;
}
public
String
getIdCard
()
{
return
idCard
;
}
public
void
setIdCard
(
String
idCard
)
{
this
.
idCard
=
idCard
;
}
public
Date
getRegTime
()
{
return
regTime
;
}
public
void
setRegTime
(
Date
regTime
)
{
this
.
regTime
=
regTime
;
}
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
server/src/main/java/com/pica/cloud/account/account/server/entity/AccountPatientInfoEntity.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
entity
;
import
java.util.Date
;
public
class
AccountPatientInfoEntity
{
private
Integer
id
;
private
Integer
acctId
;
private
String
villageName
;
private
String
mobilePhone
;
private
String
name
;
private
Long
villageId
;
private
String
townName
;
private
Long
townId
;
private
String
countyName
;
private
Long
countyId
;
private
String
cityName
;
private
Long
cityId
;
private
String
provinceName
;
private
Long
provinceId
;
private
Long
country
;
private
String
headImgUrl
;
private
String
address
;
private
String
patientAddress
;
private
String
telephone
;
private
String
socialCard
;
private
String
workUnit
;
private
String
healthFileNumber
;
private
String
paymentType
;
private
String
remarks
;
private
String
email
;
private
String
nation
;
private
Integer
createId
;
private
Date
createTime
;
private
Integer
modifyId
;
private
Date
modifyTime
;
private
int
deleteFlag
;
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
String
getVillageName
()
{
return
villageName
;
}
public
void
setVillageName
(
String
villageName
)
{
this
.
villageName
=
villageName
==
null
?
null
:
villageName
.
trim
();
}
public
String
getMobilePhone
()
{
return
mobilePhone
;
}
public
void
setMobilePhone
(
String
mobilePhone
)
{
this
.
mobilePhone
=
mobilePhone
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
Long
getVillageId
()
{
return
villageId
;
}
public
void
setVillageId
(
Long
villageId
)
{
this
.
villageId
=
villageId
;
}
public
String
getTownName
()
{
return
townName
;
}
public
void
setTownName
(
String
townName
)
{
this
.
townName
=
townName
==
null
?
null
:
townName
.
trim
();
}
public
Long
getTownId
()
{
return
townId
;
}
public
void
setTownId
(
Long
townId
)
{
this
.
townId
=
townId
;
}
public
String
getCountyName
()
{
return
countyName
;
}
public
void
setCountyName
(
String
countyName
)
{
this
.
countyName
=
countyName
==
null
?
null
:
countyName
.
trim
();
}
public
Long
getCountyId
()
{
return
countyId
;
}
public
void
setCountyId
(
Long
countyId
)
{
this
.
countyId
=
countyId
;
}
public
String
getCityName
()
{
return
cityName
;
}
public
void
setCityName
(
String
cityName
)
{
this
.
cityName
=
cityName
==
null
?
null
:
cityName
.
trim
();
}
public
Long
getCityId
()
{
return
cityId
;
}
public
void
setCityId
(
Long
cityId
)
{
this
.
cityId
=
cityId
;
}
public
String
getProvinceName
()
{
return
provinceName
;
}
public
void
setProvinceName
(
String
provinceName
)
{
this
.
provinceName
=
provinceName
==
null
?
null
:
provinceName
.
trim
();
}
public
Long
getProvinceId
()
{
return
provinceId
;
}
public
void
setProvinceId
(
Long
provinceId
)
{
this
.
provinceId
=
provinceId
;
}
public
Long
getCountry
()
{
return
country
;
}
public
void
setCountry
(
Long
country
)
{
this
.
country
=
country
;
}
public
String
getHeadImgUrl
()
{
return
headImgUrl
;
}
public
void
setHeadImgUrl
(
String
headImgUrl
)
{
this
.
headImgUrl
=
headImgUrl
==
null
?
null
:
headImgUrl
.
trim
();
}
public
String
getAddress
()
{
return
address
;
}
public
void
setAddress
(
String
address
)
{
this
.
address
=
address
==
null
?
null
:
address
.
trim
();
}
public
String
getPatientAddress
()
{
return
patientAddress
;
}
public
void
setPatientAddress
(
String
patientAddress
)
{
this
.
patientAddress
=
patientAddress
==
null
?
null
:
patientAddress
.
trim
();
}
public
String
getTelephone
()
{
return
telephone
;
}
public
void
setTelephone
(
String
telephone
)
{
this
.
telephone
=
telephone
==
null
?
null
:
telephone
.
trim
();
}
public
String
getSocialCard
()
{
return
socialCard
;
}
public
void
setSocialCard
(
String
socialCard
)
{
this
.
socialCard
=
socialCard
==
null
?
null
:
socialCard
.
trim
();
}
public
String
getWorkUnit
()
{
return
workUnit
;
}
public
void
setWorkUnit
(
String
workUnit
)
{
this
.
workUnit
=
workUnit
==
null
?
null
:
workUnit
.
trim
();
}
public
String
getHealthFileNumber
()
{
return
healthFileNumber
;
}
public
void
setHealthFileNumber
(
String
healthFileNumber
)
{
this
.
healthFileNumber
=
healthFileNumber
==
null
?
null
:
healthFileNumber
.
trim
();
}
public
String
getPaymentType
()
{
return
paymentType
;
}
public
void
setPaymentType
(
String
paymentType
)
{
this
.
paymentType
=
paymentType
==
null
?
null
:
paymentType
.
trim
();
}
public
String
getRemarks
()
{
return
remarks
;
}
public
void
setRemarks
(
String
remarks
)
{
this
.
remarks
=
remarks
==
null
?
null
:
remarks
.
trim
();
}
public
String
getEmail
()
{
return
email
;
}
public
void
setEmail
(
String
email
)
{
this
.
email
=
email
==
null
?
null
:
email
.
trim
();
}
public
String
getNation
()
{
return
nation
;
}
public
void
setNation
(
String
nation
)
{
this
.
nation
=
nation
==
null
?
null
:
nation
.
trim
();
}
public
Integer
getCreateId
()
{
return
createId
;
}
public
void
setCreateId
(
Integer
createId
)
{
this
.
createId
=
createId
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Integer
getModifyId
()
{
return
modifyId
;
}
public
void
setModifyId
(
Integer
modifyId
)
{
this
.
modifyId
=
modifyId
;
}
public
Date
getModifyTime
()
{
return
modifyTime
;
}
public
void
setModifyTime
(
Date
modifyTime
)
{
this
.
modifyTime
=
modifyTime
;
}
public
int
getDeleteFlag
()
{
return
deleteFlag
;
}
public
void
setDeleteFlag
(
int
deleteFlag
)
{
this
.
deleteFlag
=
deleteFlag
;
}
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/account/account/server/entity/AccountUnionEntity.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
entity
;
import
java.util.Date
;
public
class
AccountUnionEntity
{
private
Integer
id
;
private
Long
acctId
;
private
Integer
unionType
;
private
String
unionId
;
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
Long
getAcctId
()
{
return
acctId
;
}
public
void
setAcctId
(
Long
acctId
)
{
this
.
acctId
=
acctId
;
}
public
Integer
getUnionType
()
{
return
unionType
;
}
public
void
setUnionType
(
Integer
unionType
)
{
this
.
unionType
=
unionType
;
}
public
String
getUnionId
()
{
return
unionId
;
}
public
void
setUnionId
(
String
unionId
)
{
this
.
unionId
=
unionId
==
null
?
null
:
unionId
.
trim
();
}
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
server/src/main/java/com/pica/cloud/account/account/server/entity/AccountUser.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
entity
;
import
com.pica.cloud.foundation.utils.entity.PicaUser
;
public
class
AccountUser
extends
PicaUser
{
//账户id
private
Integer
acctId
;
//渠道来源
private
Integer
loginFrom
;
//平台来源
private
Integer
loginPlatform
;
//账户名
private
String
acctName
;
//登录ip
private
String
loginIp
;
public
Integer
getAcctId
()
{
return
acctId
;
}
public
void
setAcctId
(
Integer
acctId
)
{
this
.
acctId
=
acctId
;
}
public
Integer
getLoginFrom
()
{
return
loginFrom
;
}
public
void
setLoginFrom
(
Integer
loginFrom
)
{
this
.
loginFrom
=
loginFrom
;
}
public
Integer
getLoginPlatform
()
{
return
loginPlatform
;
}
public
void
setLoginPlatform
(
Integer
loginPlatform
)
{
this
.
loginPlatform
=
loginPlatform
;
}
public
String
getAcctName
()
{
return
acctName
;
}
public
void
setAcctName
(
String
acctName
)
{
this
.
acctName
=
acctName
;
}
public
String
getLoginIp
()
{
return
loginIp
;
}
public
void
setLoginIp
(
String
loginIp
)
{
this
.
loginIp
=
loginIp
;
}
}
server/src/main/java/com/pica/cloud/account/account/server/entity/AccountWeChatInfoEntity.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
entity
;
import
java.util.Date
;
public
class
AccountWeChatInfoEntity
{
private
Integer
id
;
private
String
unionid
;
private
String
openid
;
private
String
nickname
;
private
String
headImgUrl
;
private
int
sex
;
private
String
country
;
private
String
province
;
private
String
city
;
private
String
language
;
private
Integer
type
;
private
String
privilege
;
private
Integer
subscribe
;
private
Date
subscribeTime
;
private
String
remark
;
private
String
groupid
;
private
String
tagidList
;
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
String
getUnionid
()
{
return
unionid
;
}
public
void
setUnionid
(
String
unionid
)
{
this
.
unionid
=
unionid
;
}
public
String
getOpenid
()
{
return
openid
;
}
public
void
setOpenid
(
String
openid
)
{
this
.
openid
=
openid
;
}
public
String
getNickname
()
{
return
nickname
;
}
public
void
setNickname
(
String
nickname
)
{
this
.
nickname
=
nickname
;
}
public
String
getHeadImgUrl
()
{
return
headImgUrl
;
}
public
void
setHeadImgUrl
(
String
headImgUrl
)
{
this
.
headImgUrl
=
headImgUrl
;
}
public
int
getSex
()
{
return
sex
;
}
public
void
setSex
(
int
sex
)
{
this
.
sex
=
sex
;
}
public
String
getCountry
()
{
return
country
;
}
public
void
setCountry
(
String
country
)
{
this
.
country
=
country
;
}
public
String
getProvince
()
{
return
province
;
}
public
void
setProvince
(
String
province
)
{
this
.
province
=
province
;
}
public
String
getCity
()
{
return
city
;
}
public
void
setCity
(
String
city
)
{
this
.
city
=
city
;
}
public
String
getLanguage
()
{
return
language
;
}
public
void
setLanguage
(
String
language
)
{
this
.
language
=
language
;
}
public
Integer
getType
()
{
return
type
;
}
public
void
setType
(
Integer
type
)
{
this
.
type
=
type
;
}
public
String
getPrivilege
()
{
return
privilege
;
}
public
void
setPrivilege
(
String
privilege
)
{
this
.
privilege
=
privilege
;
}
public
Integer
getSubscribe
()
{
return
subscribe
;
}
public
void
setSubscribe
(
Integer
subscribe
)
{
this
.
subscribe
=
subscribe
;
}
public
Date
getSubscribeTime
()
{
return
subscribeTime
;
}
public
void
setSubscribeTime
(
Date
subscribeTime
)
{
this
.
subscribeTime
=
subscribeTime
;
}
public
String
getRemark
()
{
return
remark
;
}
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
public
String
getGroupid
()
{
return
groupid
;
}
public
void
setGroupid
(
String
groupid
)
{
this
.
groupid
=
groupid
;
}
public
String
getTagidList
()
{
return
tagidList
;
}
public
void
setTagidList
(
String
tagidList
)
{
this
.
tagidList
=
tagidList
;
}
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
server/src/main/java/com/pica/cloud/account/account/server/entity/AgreementEntity.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
entity
;
import
java.util.Date
;
public
class
AgreementEntity
{
private
Long
id
;
private
Integer
agreement_type
;
private
String
version
;
private
String
agreement_content
;
private
Integer
delete_flag
;
private
Long
created_id
;
private
Date
created_time
;
private
Long
modified_id
;
private
Date
modified_time
;
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
Integer
getAgreement_type
()
{
return
agreement_type
;
}
public
void
setAgreement_type
(
Integer
agreement_type
)
{
this
.
agreement_type
=
agreement_type
;
}
public
String
getVersion
()
{
return
version
;
}
public
void
setVersion
(
String
version
)
{
this
.
version
=
version
==
null
?
null
:
version
.
trim
();
}
public
Integer
getDelete_flag
()
{
return
delete_flag
;
}
public
void
setDelete_flag
(
Integer
delete_flag
)
{
this
.
delete_flag
=
delete_flag
;
}
public
Long
getCreated_id
()
{
return
created_id
;
}
public
void
setCreated_id
(
Long
created_id
)
{
this
.
created_id
=
created_id
;
}
public
Date
getCreated_time
()
{
return
created_time
;
}
public
void
setCreated_time
(
Date
created_time
)
{
this
.
created_time
=
created_time
;
}
public
Long
getModified_id
()
{
return
modified_id
;
}
public
void
setModified_id
(
Long
modified_id
)
{
this
.
modified_id
=
modified_id
;
}
public
Date
getModified_time
()
{
return
modified_time
;
}
public
void
setModified_time
(
Date
modified_time
)
{
this
.
modified_time
=
modified_time
;
}
public
String
getAgreement_content
()
{
return
agreement_content
;
}
public
void
setAgreement_content
(
String
agreement_content
)
{
this
.
agreement_content
=
agreement_content
==
null
?
null
:
agreement_content
.
trim
();
}
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/account/account/server/entity/AgreementLogEntity.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
entity
;
import
java.util.Date
;
public
class
AgreementLogEntity
{
private
Long
id
;
private
Long
doctor_id
;
private
Integer
agreement_type
;
private
String
version
;
private
Integer
delete_flag
;
private
Long
created_id
;
private
Date
created_time
;
private
Long
modified_id
;
private
Date
modified_time
;
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
Long
getDoctor_id
()
{
return
doctor_id
;
}
public
void
setDoctor_id
(
Long
doctor_id
)
{
this
.
doctor_id
=
doctor_id
;
}
public
Integer
getAgreement_type
()
{
return
agreement_type
;
}
public
void
setAgreement_type
(
Integer
agreement_type
)
{
this
.
agreement_type
=
agreement_type
;
}
public
String
getVersion
()
{
return
version
;
}
public
void
setVersion
(
String
version
)
{
this
.
version
=
version
==
null
?
null
:
version
.
trim
();
}
public
Integer
getDelete_flag
()
{
return
delete_flag
;
}
public
void
setDelete_flag
(
Integer
delete_flag
)
{
this
.
delete_flag
=
delete_flag
;
}
public
Long
getCreated_id
()
{
return
created_id
;
}
public
void
setCreated_id
(
Long
created_id
)
{
this
.
created_id
=
created_id
;
}
public
Date
getCreated_time
()
{
return
created_time
;
}
public
void
setCreated_time
(
Date
created_time
)
{
this
.
created_time
=
created_time
;
}
public
Long
getModified_id
()
{
return
modified_id
;
}
public
void
setModified_id
(
Long
modified_id
)
{
this
.
modified_id
=
modified_id
;
}
public
Date
getModified_time
()
{
return
modified_time
;
}
public
void
setModified_time
(
Date
modified_time
)
{
this
.
modified_time
=
modified_time
;
}
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/account/account/server/entity/Doctor.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
entity
;
import
java.util.Date
;
public
class
Doctor
{
private
Integer
id
;
private
Integer
acctId
;
private
Integer
sex
;
private
String
name
;
private
Integer
age
;
private
String
mobilePhone
;
private
String
tel
;
private
Integer
status
;
private
Integer
type
;
private
Integer
hospitalId
;
private
Integer
departmentId
;
private
Integer
titleId
;
private
String
hospital
;
private
String
department
;
private
String
title
;
private
String
certImageUrl
;
private
String
avatarImageUrl
;
private
Date
authTime
;
private
String
honor
;
private
String
skills
;
private
Integer
thumbUpNum
;
private
String
email
;
private
String
qrcode
;
private
String
nickname
;
private
String
personalSign
;
private
Integer
deleteFlag
;
private
Integer
creatId
;
private
Date
creatTime
;
private
Integer
modifyId
;
private
Date
modifyTime
;
private
Integer
praiseNum
;
private
String
password
;
private
String
info
;
private
String
rank
;
private
Long
province
;
private
String
provinceName
;
private
Long
city
;
private
String
cityName
;
private
Long
county
;
private
String
countyName
;
private
Long
town
;
private
String
townName
;
private
String
inviteCode
;
private
Date
inviteStartTime
;
private
String
gaoxueyaPassword
;
private
Integer
smsSendNum
;
private
Integer
totalSmsSendNum
;
private
Integer
entireFlag
;
private
Integer
doctorProjectType
;
private
Date
regTime
;
private
Date
lastLoginTime
;
private
String
unionid
;
private
Integer
registerSource
;
private
String
comment
;
private
Integer
administerTitleId
;
private
String
administerTitle
;
private
Integer
registerType
;
private
Date
firstLoginTime
;
private
String
card
;
private
Date
birthday
;
private
Integer
showFlag
;
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
getSex
()
{
return
sex
;
}
public
void
setSex
(
Integer
sex
)
{
this
.
sex
=
sex
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
==
null
?
null
:
name
.
trim
();
}
public
Integer
getAge
()
{
return
age
;
}
public
void
setAge
(
Integer
age
)
{
this
.
age
=
age
;
}
public
String
getMobilePhone
()
{
return
mobilePhone
;
}
public
void
setMobilePhone
(
String
mobilePhone
)
{
this
.
mobilePhone
=
mobilePhone
==
null
?
null
:
mobilePhone
.
trim
();
}
public
String
getTel
()
{
return
tel
;
}
public
void
setTel
(
String
tel
)
{
this
.
tel
=
tel
==
null
?
null
:
tel
.
trim
();
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
public
Integer
getType
()
{
return
type
;
}
public
void
setType
(
Integer
type
)
{
this
.
type
=
type
;
}
public
Integer
getHospitalId
()
{
return
hospitalId
;
}
public
void
setHospitalId
(
Integer
hospitalId
)
{
this
.
hospitalId
=
hospitalId
;
}
public
Integer
getDepartmentId
()
{
return
departmentId
;
}
public
void
setDepartmentId
(
Integer
departmentId
)
{
this
.
departmentId
=
departmentId
;
}
public
Integer
getTitleId
()
{
return
titleId
;
}
public
void
setTitleId
(
Integer
titleId
)
{
this
.
titleId
=
titleId
;
}
public
String
getHospital
()
{
return
hospital
;
}
public
void
setHospital
(
String
hospital
)
{
this
.
hospital
=
hospital
==
null
?
null
:
hospital
.
trim
();
}
public
String
getDepartment
()
{
return
department
;
}
public
void
setDepartment
(
String
department
)
{
this
.
department
=
department
==
null
?
null
:
department
.
trim
();
}
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
==
null
?
null
:
title
.
trim
();
}
public
String
getCertImageUrl
()
{
return
certImageUrl
;
}
public
void
setCertImageUrl
(
String
certImageUrl
)
{
this
.
certImageUrl
=
certImageUrl
==
null
?
null
:
certImageUrl
.
trim
();
}
public
String
getAvatarImageUrl
()
{
return
avatarImageUrl
;
}
public
void
setAvatarImageUrl
(
String
avatarImageUrl
)
{
this
.
avatarImageUrl
=
avatarImageUrl
==
null
?
null
:
avatarImageUrl
.
trim
();
}
public
Date
getAuthTime
()
{
return
authTime
;
}
public
void
setAuthTime
(
Date
authTime
)
{
this
.
authTime
=
authTime
;
}
public
String
getHonor
()
{
return
honor
;
}
public
void
setHonor
(
String
honor
)
{
this
.
honor
=
honor
==
null
?
null
:
honor
.
trim
();
}
public
String
getSkills
()
{
return
skills
;
}
public
void
setSkills
(
String
skills
)
{
this
.
skills
=
skills
==
null
?
null
:
skills
.
trim
();
}
public
Integer
getThumbUpNum
()
{
return
thumbUpNum
;
}
public
void
setThumbUpNum
(
Integer
thumbUpNum
)
{
this
.
thumbUpNum
=
thumbUpNum
;
}
public
String
getEmail
()
{
return
email
;
}
public
void
setEmail
(
String
email
)
{
this
.
email
=
email
==
null
?
null
:
email
.
trim
();
}
public
String
getQrcode
()
{
return
qrcode
;
}
public
void
setQrcode
(
String
qrcode
)
{
this
.
qrcode
=
qrcode
==
null
?
null
:
qrcode
.
trim
();
}
public
String
getNickname
()
{
return
nickname
;
}
public
void
setNickname
(
String
nickname
)
{
this
.
nickname
=
nickname
==
null
?
null
:
nickname
.
trim
();
}
public
String
getPersonalSign
()
{
return
personalSign
;
}
public
void
setPersonalSign
(
String
personalSign
)
{
this
.
personalSign
=
personalSign
==
null
?
null
:
personalSign
.
trim
();
}
public
Integer
getDeleteFlag
()
{
return
deleteFlag
;
}
public
void
setDeleteFlag
(
Integer
deleteFlag
)
{
this
.
deleteFlag
=
deleteFlag
;
}
public
Integer
getCreatId
()
{
return
creatId
;
}
public
void
setCreatId
(
Integer
creatId
)
{
this
.
creatId
=
creatId
;
}
public
Date
getCreatTime
()
{
return
creatTime
;
}
public
void
setCreatTime
(
Date
creatTime
)
{
this
.
creatTime
=
creatTime
;
}
public
Integer
getModifyId
()
{
return
modifyId
;
}
public
void
setModifyId
(
Integer
modifyId
)
{
this
.
modifyId
=
modifyId
;
}
public
Date
getModifyTime
()
{
return
modifyTime
;
}
public
void
setModifyTime
(
Date
modifyTime
)
{
this
.
modifyTime
=
modifyTime
;
}
public
Integer
getPraiseNum
()
{
return
praiseNum
;
}
public
void
setPraiseNum
(
Integer
praiseNum
)
{
this
.
praiseNum
=
praiseNum
;
}
public
String
getPassword
()
{
return
password
;
}
public
void
setPassword
(
String
password
)
{
this
.
password
=
password
==
null
?
null
:
password
.
trim
();
}
public
String
getInfo
()
{
return
info
;
}
public
void
setInfo
(
String
info
)
{
this
.
info
=
info
==
null
?
null
:
info
.
trim
();
}
public
String
getRank
()
{
return
rank
;
}
public
void
setRank
(
String
rank
)
{
this
.
rank
=
rank
==
null
?
null
:
rank
.
trim
();
}
public
Long
getProvince
()
{
return
province
;
}
public
void
setProvince
(
Long
province
)
{
this
.
province
=
province
;
}
public
String
getProvinceName
()
{
return
provinceName
;
}
public
void
setProvinceName
(
String
provinceName
)
{
this
.
provinceName
=
provinceName
==
null
?
null
:
provinceName
.
trim
();
}
public
Long
getCity
()
{
return
city
;
}
public
void
setCity
(
Long
city
)
{
this
.
city
=
city
;
}
public
String
getCityName
()
{
return
cityName
;
}
public
void
setCityName
(
String
cityName
)
{
this
.
cityName
=
cityName
==
null
?
null
:
cityName
.
trim
();
}
public
Long
getCounty
()
{
return
county
;
}
public
void
setCounty
(
Long
county
)
{
this
.
county
=
county
;
}
public
String
getCountyName
()
{
return
countyName
;
}
public
void
setCountyName
(
String
countyName
)
{
this
.
countyName
=
countyName
==
null
?
null
:
countyName
.
trim
();
}
public
Long
getTown
()
{
return
town
;
}
public
void
setTown
(
Long
town
)
{
this
.
town
=
town
;
}
public
String
getTownName
()
{
return
townName
;
}
public
void
setTownName
(
String
townName
)
{
this
.
townName
=
townName
==
null
?
null
:
townName
.
trim
();
}
public
String
getInviteCode
()
{
return
inviteCode
;
}
public
void
setInviteCode
(
String
inviteCode
)
{
this
.
inviteCode
=
inviteCode
==
null
?
null
:
inviteCode
.
trim
();
}
public
Date
getInviteStartTime
()
{
return
inviteStartTime
;
}
public
void
setInviteStartTime
(
Date
inviteStartTime
)
{
this
.
inviteStartTime
=
inviteStartTime
;
}
public
String
getGaoxueyaPassword
()
{
return
gaoxueyaPassword
;
}
public
void
setGaoxueyaPassword
(
String
gaoxueyaPassword
)
{
this
.
gaoxueyaPassword
=
gaoxueyaPassword
==
null
?
null
:
gaoxueyaPassword
.
trim
();
}
public
Integer
getSmsSendNum
()
{
return
smsSendNum
;
}
public
void
setSmsSendNum
(
Integer
smsSendNum
)
{
this
.
smsSendNum
=
smsSendNum
;
}
public
Integer
getTotalSmsSendNum
()
{
return
totalSmsSendNum
;
}
public
void
setTotalSmsSendNum
(
Integer
totalSmsSendNum
)
{
this
.
totalSmsSendNum
=
totalSmsSendNum
;
}
public
Integer
getEntireFlag
()
{
return
entireFlag
;
}
public
void
setEntireFlag
(
Integer
entireFlag
)
{
this
.
entireFlag
=
entireFlag
;
}
public
Integer
getDoctorProjectType
()
{
return
doctorProjectType
;
}
public
void
setDoctorProjectType
(
Integer
doctorProjectType
)
{
this
.
doctorProjectType
=
doctorProjectType
;
}
public
Date
getRegTime
()
{
return
regTime
;
}
public
void
setRegTime
(
Date
regTime
)
{
this
.
regTime
=
regTime
;
}
public
Date
getLastLoginTime
()
{
return
lastLoginTime
;
}
public
void
setLastLoginTime
(
Date
lastLoginTime
)
{
this
.
lastLoginTime
=
lastLoginTime
;
}
public
String
getUnionid
()
{
return
unionid
;
}
public
void
setUnionid
(
String
unionid
)
{
this
.
unionid
=
unionid
==
null
?
null
:
unionid
.
trim
();
}
public
Integer
getRegisterSource
()
{
return
registerSource
;
}
public
void
setRegisterSource
(
Integer
registerSource
)
{
this
.
registerSource
=
registerSource
;
}
public
String
getComment
()
{
return
comment
;
}
public
void
setComment
(
String
comment
)
{
this
.
comment
=
comment
==
null
?
null
:
comment
.
trim
();
}
public
Integer
getAdministerTitleId
()
{
return
administerTitleId
;
}
public
void
setAdministerTitleId
(
Integer
administerTitleId
)
{
this
.
administerTitleId
=
administerTitleId
;
}
public
String
getAdministerTitle
()
{
return
administerTitle
;
}
public
void
setAdministerTitle
(
String
administerTitle
)
{
this
.
administerTitle
=
administerTitle
==
null
?
null
:
administerTitle
.
trim
();
}
public
Integer
getRegisterType
()
{
return
registerType
;
}
public
void
setRegisterType
(
Integer
registerType
)
{
this
.
registerType
=
registerType
;
}
public
Date
getFirstLoginTime
()
{
return
firstLoginTime
;
}
public
void
setFirstLoginTime
(
Date
firstLoginTime
)
{
this
.
firstLoginTime
=
firstLoginTime
;
}
public
String
getCard
()
{
return
card
;
}
public
void
setCard
(
String
card
)
{
this
.
card
=
card
==
null
?
null
:
card
.
trim
();
}
public
Date
getBirthday
()
{
return
birthday
;
}
public
void
setBirthday
(
Date
birthday
)
{
this
.
birthday
=
birthday
;
}
public
Integer
getShowFlag
()
{
return
showFlag
;
}
public
void
setShowFlag
(
Integer
showFlag
)
{
this
.
showFlag
=
showFlag
;
}
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/account/account/server/entity/DoctorEntity.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
entity
;
import
com.pica.cloud.foundation.utils.utils.date.DateAdapter
;
import
javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter
;
import
java.util.Date
;
/**
* Created on 2019/9/10 17:52
* author:crs
* Description:医生基本信息
*/
public
class
DoctorEntity
{
private
Integer
id
;
private
Integer
sex
;
private
String
name
=
""
;
private
String
mobile_phone
=
""
;
private
Integer
status
;
private
Integer
type
;
private
Integer
hospital_id
;
private
Integer
department_id
;
private
Integer
title_id
;
private
String
cert_image_url
=
""
;
private
String
avatar_image_url
=
""
;
@XmlJavaTypeAdapter
(
DateAdapter
.
class
)
protected
Date
auth_time
;
@XmlJavaTypeAdapter
(
DateAdapter
.
class
)
protected
Date
invite_start_time
;
private
String
honor
=
""
;
private
String
skills
=
""
;
private
Integer
thumb_up_num
;
private
String
email
=
""
;
private
String
qrcode
=
""
;
private
String
nickname
=
""
;
private
String
personal_sign
=
""
;
private
Integer
praise_num
;
private
String
password
=
""
;
private
String
gaoxueya_password
=
""
;
private
String
info
=
""
;
private
String
rank
=
""
;
private
Long
town
;
private
String
town_name
=
""
;
private
Long
county
;
private
String
county_name
=
""
;
private
Long
city
;
private
String
city_name
=
""
;
private
Integer
province
;
private
String
province_name
=
""
;
private
String
hospital
=
""
;
private
String
department
=
""
;
private
String
title
=
""
;
private
String
card
=
""
;
private
String
invite_code
=
""
;
private
int
entire_flag
;
// 1未补全 2补全
private
int
sms_send_num
;
// 发送短信数量
private
int
total_sms_send_num
;
// 可发送短信总量
private
int
doctor_project_type
;
// 医生项目分类
// private String open_id;
private
String
unionid
=
""
;
private
Integer
administer_title_id
;
// 行政职称id
private
String
administer_title
;
// 行政职称
private
String
school_name
;
// 学校名称
private
Integer
major_id
;
// 专业id
private
String
major_name
;
// 专业名称
private
String
education_id
;
// 学历no,p_constants表的no
private
String
education_name
;
// 学历名称
private
String
year
;
// 入学年份
protected
Date
birthday
;
//出生年月
private
Integer
register_source
;
// 注册来源 1.android, 2.ios, 3.saas, 4.wechat, 5.hypertension, 6.kf
private
Integer
register_type
;
// 注册类型 1医学生 2非医学生
private
String
token
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
Integer
getSex
()
{
return
sex
;
}
public
void
setSex
(
Integer
sex
)
{
this
.
sex
=
sex
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getMobile_phone
()
{
return
mobile_phone
;
}
public
void
setMobile_phone
(
String
mobile_phone
)
{
this
.
mobile_phone
=
mobile_phone
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
public
Integer
getType
()
{
return
type
;
}
public
void
setType
(
Integer
type
)
{
this
.
type
=
type
;
}
public
Integer
getHospital_id
()
{
return
hospital_id
;
}
public
void
setHospital_id
(
Integer
hospital_id
)
{
this
.
hospital_id
=
hospital_id
;
}
public
Integer
getDepartment_id
()
{
return
department_id
;
}
public
void
setDepartment_id
(
Integer
department_id
)
{
this
.
department_id
=
department_id
;
}
public
Integer
getTitle_id
()
{
return
title_id
;
}
public
void
setTitle_id
(
Integer
title_id
)
{
this
.
title_id
=
title_id
;
}
public
String
getCert_image_url
()
{
return
cert_image_url
;
}
public
void
setCert_image_url
(
String
cert_image_url
)
{
this
.
cert_image_url
=
cert_image_url
;
}
public
String
getAvatar_image_url
()
{
return
avatar_image_url
;
}
public
void
setAvatar_image_url
(
String
avatar_image_url
)
{
this
.
avatar_image_url
=
avatar_image_url
;
}
public
Date
getAuth_time
()
{
return
auth_time
;
}
public
void
setAuth_time
(
Date
auth_time
)
{
this
.
auth_time
=
auth_time
;
}
public
Date
getInvite_start_time
()
{
return
invite_start_time
;
}
public
void
setInvite_start_time
(
Date
invite_start_time
)
{
this
.
invite_start_time
=
invite_start_time
;
}
public
String
getHonor
()
{
return
honor
;
}
public
void
setHonor
(
String
honor
)
{
this
.
honor
=
honor
;
}
public
String
getSkills
()
{
return
skills
;
}
public
void
setSkills
(
String
skills
)
{
this
.
skills
=
skills
;
}
public
Integer
getThumb_up_num
()
{
return
thumb_up_num
;
}
public
void
setThumb_up_num
(
Integer
thumb_up_num
)
{
this
.
thumb_up_num
=
thumb_up_num
;
}
public
String
getEmail
()
{
return
email
;
}
public
void
setEmail
(
String
email
)
{
this
.
email
=
email
;
}
public
String
getQrcode
()
{
return
qrcode
;
}
public
void
setQrcode
(
String
qrcode
)
{
this
.
qrcode
=
qrcode
;
}
public
String
getNickname
()
{
return
nickname
;
}
public
void
setNickname
(
String
nickname
)
{
this
.
nickname
=
nickname
;
}
public
String
getPersonal_sign
()
{
return
personal_sign
;
}
public
void
setPersonal_sign
(
String
personal_sign
)
{
this
.
personal_sign
=
personal_sign
;
}
public
Integer
getPraise_num
()
{
return
praise_num
;
}
public
void
setPraise_num
(
Integer
praise_num
)
{
this
.
praise_num
=
praise_num
;
}
public
String
getPassword
()
{
return
password
;
}
public
void
setPassword
(
String
password
)
{
this
.
password
=
password
;
}
public
String
getGaoxueya_password
()
{
return
gaoxueya_password
;
}
public
void
setGaoxueya_password
(
String
gaoxueya_password
)
{
this
.
gaoxueya_password
=
gaoxueya_password
;
}
public
String
getInfo
()
{
return
info
;
}
public
void
setInfo
(
String
info
)
{
this
.
info
=
info
;
}
public
String
getRank
()
{
return
rank
;
}
public
void
setRank
(
String
rank
)
{
this
.
rank
=
rank
;
}
public
Long
getTown
()
{
return
town
;
}
public
void
setTown
(
Long
town
)
{
this
.
town
=
town
;
}
public
String
getTown_name
()
{
return
town_name
;
}
public
void
setTown_name
(
String
town_name
)
{
this
.
town_name
=
town_name
;
}
public
Long
getCounty
()
{
return
county
;
}
public
void
setCounty
(
Long
county
)
{
this
.
county
=
county
;
}
public
String
getCounty_name
()
{
return
county_name
;
}
public
void
setCounty_name
(
String
county_name
)
{
this
.
county_name
=
county_name
;
}
public
Long
getCity
()
{
return
city
;
}
public
void
setCity
(
Long
city
)
{
this
.
city
=
city
;
}
public
String
getCity_name
()
{
return
city_name
;
}
public
void
setCity_name
(
String
city_name
)
{
this
.
city_name
=
city_name
;
}
public
Integer
getProvince
()
{
return
province
;
}
public
void
setProvince
(
Integer
province
)
{
this
.
province
=
province
;
}
public
String
getProvince_name
()
{
return
province_name
;
}
public
void
setProvince_name
(
String
province_name
)
{
this
.
province_name
=
province_name
;
}
public
String
getHospital
()
{
return
hospital
;
}
public
void
setHospital
(
String
hospital
)
{
this
.
hospital
=
hospital
;
}
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
;
}
public
String
getCard
()
{
return
card
;
}
public
void
setCard
(
String
card
)
{
this
.
card
=
card
;
}
public
String
getInvite_code
()
{
return
invite_code
;
}
public
void
setInvite_code
(
String
invite_code
)
{
this
.
invite_code
=
invite_code
;
}
public
int
getEntire_flag
()
{
return
entire_flag
;
}
public
void
setEntire_flag
(
int
entire_flag
)
{
this
.
entire_flag
=
entire_flag
;
}
public
int
getSms_send_num
()
{
return
sms_send_num
;
}
public
void
setSms_send_num
(
int
sms_send_num
)
{
this
.
sms_send_num
=
sms_send_num
;
}
public
int
getTotal_sms_send_num
()
{
return
total_sms_send_num
;
}
public
void
setTotal_sms_send_num
(
int
total_sms_send_num
)
{
this
.
total_sms_send_num
=
total_sms_send_num
;
}
public
int
getDoctor_project_type
()
{
return
doctor_project_type
;
}
public
void
setDoctor_project_type
(
int
doctor_project_type
)
{
this
.
doctor_project_type
=
doctor_project_type
;
}
public
String
getUnionid
()
{
return
unionid
;
}
public
void
setUnionid
(
String
unionid
)
{
this
.
unionid
=
unionid
;
}
public
Integer
getAdminister_title_id
()
{
return
administer_title_id
;
}
public
void
setAdminister_title_id
(
Integer
administer_title_id
)
{
this
.
administer_title_id
=
administer_title_id
;
}
public
String
getAdminister_title
()
{
return
administer_title
;
}
public
void
setAdminister_title
(
String
administer_title
)
{
this
.
administer_title
=
administer_title
;
}
public
String
getSchool_name
()
{
return
school_name
;
}
public
void
setSchool_name
(
String
school_name
)
{
this
.
school_name
=
school_name
;
}
public
Integer
getMajor_id
()
{
return
major_id
;
}
public
void
setMajor_id
(
Integer
major_id
)
{
this
.
major_id
=
major_id
;
}
public
String
getMajor_name
()
{
return
major_name
;
}
public
void
setMajor_name
(
String
major_name
)
{
this
.
major_name
=
major_name
;
}
public
String
getEducation_id
()
{
return
education_id
;
}
public
void
setEducation_id
(
String
education_id
)
{
this
.
education_id
=
education_id
;
}
public
String
getEducation_name
()
{
return
education_name
;
}
public
void
setEducation_name
(
String
education_name
)
{
this
.
education_name
=
education_name
;
}
public
String
getYear
()
{
return
year
;
}
public
void
setYear
(
String
year
)
{
this
.
year
=
year
;
}
public
Date
getBirthday
()
{
return
birthday
;
}
public
void
setBirthday
(
Date
birthday
)
{
this
.
birthday
=
birthday
;
}
public
Integer
getRegister_source
()
{
return
register_source
;
}
public
void
setRegister_source
(
Integer
register_source
)
{
this
.
register_source
=
register_source
;
}
public
Integer
getRegister_type
()
{
return
register_type
;
}
public
void
setRegister_type
(
Integer
register_type
)
{
this
.
register_type
=
register_type
;
}
public
String
getToken
()
{
return
token
;
}
public
void
setToken
(
String
token
)
{
this
.
token
=
token
;
}
}
server/src/main/java/com/pica/cloud/account/account/server/entity/EncryptEntity.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
entity
;
/**
* 加解密数据模型
*/
public
class
EncryptEntity
{
/**
* 加密后的密文
*/
private
String
key
;
/**
* 加密后的数据
*/
private
String
content
;
public
String
getKey
()
{
return
key
;
}
public
void
setKey
(
String
key
)
{
this
.
key
=
key
;
}
public
String
getContent
()
{
return
content
;
}
public
void
setContent
(
String
content
)
{
this
.
content
=
content
;
}
// @Override
// public String toString() {
// return "EncryptEntity{" +
// "key='" + key + '\'' +
// ", content='" + content + '\'' +
// '}';
// }
}
server/src/main/java/com/pica/cloud/account/account/server/entity/LogLoginEntity.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
entity
;
import
com.pica.cloud.account.account.server.log.AccountLogEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.util.Date
;
@ApiModel
public
class
LogLoginEntity
extends
AccountLogEntity
{
private
Integer
id
;
private
Integer
acctId
;
private
String
acctName
;
private
int
productType
;
private
int
sourceType
;
private
int
loginType
;
private
String
loginIp
;
private
Date
loginTime
;
//成功,失败
@ApiModelProperty
(
"登陆状态"
)
private
int
loginStatus
;
private
Integer
createId
;
private
Date
createTime
;
private
Integer
modifyId
;
private
Date
modifyTime
;
private
int
deleteFlag
;
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
String
getAcctName
()
{
return
acctName
;
}
public
void
setAcctName
(
String
acctName
)
{
this
.
acctName
=
acctName
;
}
public
int
getProductType
()
{
return
productType
;
}
public
void
setProductType
(
int
productType
)
{
this
.
productType
=
productType
;
}
public
int
getSourceType
()
{
return
sourceType
;
}
public
void
setSourceType
(
int
sourceType
)
{
this
.
sourceType
=
sourceType
;
}
public
int
getLoginType
()
{
return
loginType
;
}
public
void
setLoginType
(
int
loginType
)
{
this
.
loginType
=
loginType
;
}
public
String
getLoginIp
()
{
return
loginIp
;
}
public
void
setLoginIp
(
String
loginIp
)
{
this
.
loginIp
=
loginIp
;
}
public
Date
getLoginTime
()
{
return
loginTime
;
}
public
void
setLoginTime
(
Date
loginTime
)
{
this
.
loginTime
=
loginTime
;
}
public
int
getLoginStatus
()
{
return
loginStatus
;
}
public
void
setLoginStatus
(
int
loginStatus
)
{
this
.
loginStatus
=
loginStatus
;
}
public
Integer
getCreateId
()
{
return
createId
;
}
public
void
setCreateId
(
Integer
createId
)
{
this
.
createId
=
createId
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Integer
getModifyId
()
{
return
modifyId
;
}
public
void
setModifyId
(
Integer
modifyId
)
{
this
.
modifyId
=
modifyId
;
}
public
Date
getModifyTime
()
{
return
modifyTime
;
}
public
void
setModifyTime
(
Date
modifyTime
)
{
this
.
modifyTime
=
modifyTime
;
}
public
int
getDeleteFlag
()
{
return
deleteFlag
;
}
public
void
setDeleteFlag
(
int
deleteFlag
)
{
this
.
deleteFlag
=
deleteFlag
;
}
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/account/account/server/entity/LogPWDModifyEntity.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
entity
;
import
com.pica.cloud.account.account.server.log.AccountLogEntity
;
import
java.util.Date
;
public
class
LogPWDModifyEntity
extends
AccountLogEntity
{
private
Integer
id
;
private
String
mobilePhone
;
private
Date
modifiedTime
;
private
Integer
modifiedId
;
private
String
oldPwd
;
private
String
newPwd
;
private
Integer
deleteFlag
;
private
Integer
createdId
;
private
Date
createdTime
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
String
getMobilePhone
()
{
return
mobilePhone
;
}
public
void
setMobilePhone
(
String
mobilePhone
)
{
this
.
mobilePhone
=
mobilePhone
==
null
?
null
:
mobilePhone
.
trim
();
}
public
Date
getModifiedTime
()
{
return
modifiedTime
;
}
public
void
setModifiedTime
(
Date
modifiedTime
)
{
this
.
modifiedTime
=
modifiedTime
;
}
public
Integer
getModifiedId
()
{
return
modifiedId
;
}
public
void
setModifiedId
(
Integer
modifiedId
)
{
this
.
modifiedId
=
modifiedId
;
}
public
String
getOldPwd
()
{
return
oldPwd
;
}
public
void
setOldPwd
(
String
oldPwd
)
{
this
.
oldPwd
=
oldPwd
==
null
?
null
:
oldPwd
.
trim
();
}
public
String
getNewPwd
()
{
return
newPwd
;
}
public
void
setNewPwd
(
String
newPwd
)
{
this
.
newPwd
=
newPwd
==
null
?
null
:
newPwd
.
trim
();
}
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
;
}
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/account/account/server/entity/LogUserInfoEntity.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
entity
;
import
com.pica.cloud.account.account.server.log.AccountLogEntity
;
import
java.util.Date
;
public
class
LogUserInfoEntity
extends
AccountLogEntity
{
private
Integer
id
;
private
Integer
acctId
;
private
String
villageName
;
private
Long
villageId
;
private
String
townName
;
private
Long
townId
;
private
String
countyName
;
private
Long
countyId
;
private
String
cityName
;
private
Long
cityId
;
private
String
provinceName
;
private
Long
provinceId
;
private
Long
country
;
private
String
headImgUrl
;
private
String
address
;
private
String
patientAddress
;
private
String
telephone
;
private
String
socialCard
;
private
String
workUnit
;
private
String
healthFileNumber
;
private
String
paymentType
;
private
String
remarks
;
private
String
email
;
private
String
nation
;
private
Integer
createId
;
private
Date
createTime
;
private
Integer
modifyId
;
private
Date
modifyTime
;
private
int
deleteFlag
;
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
String
getVillageName
()
{
return
villageName
;
}
public
void
setVillageName
(
String
villageName
)
{
this
.
villageName
=
villageName
==
null
?
null
:
villageName
.
trim
();
}
public
Long
getVillageId
()
{
return
villageId
;
}
public
void
setVillageId
(
Long
villageId
)
{
this
.
villageId
=
villageId
;
}
public
String
getTownName
()
{
return
townName
;
}
public
void
setTownName
(
String
townName
)
{
this
.
townName
=
townName
==
null
?
null
:
townName
.
trim
();
}
public
Long
getTownId
()
{
return
townId
;
}
public
void
setTownId
(
Long
townId
)
{
this
.
townId
=
townId
;
}
public
String
getCountyName
()
{
return
countyName
;
}
public
void
setCountyName
(
String
countyName
)
{
this
.
countyName
=
countyName
==
null
?
null
:
countyName
.
trim
();
}
public
Long
getCountyId
()
{
return
countyId
;
}
public
void
setCountyId
(
Long
countyId
)
{
this
.
countyId
=
countyId
;
}
public
String
getCityName
()
{
return
cityName
;
}
public
void
setCityName
(
String
cityName
)
{
this
.
cityName
=
cityName
==
null
?
null
:
cityName
.
trim
();
}
public
Long
getCityId
()
{
return
cityId
;
}
public
void
setCityId
(
Long
cityId
)
{
this
.
cityId
=
cityId
;
}
public
String
getProvinceName
()
{
return
provinceName
;
}
public
void
setProvinceName
(
String
provinceName
)
{
this
.
provinceName
=
provinceName
==
null
?
null
:
provinceName
.
trim
();
}
public
Long
getProvinceId
()
{
return
provinceId
;
}
public
void
setProvinceId
(
Long
provinceId
)
{
this
.
provinceId
=
provinceId
;
}
public
Long
getCountry
()
{
return
country
;
}
public
void
setCountry
(
Long
country
)
{
this
.
country
=
country
;
}
public
String
getHeadImgUrl
()
{
return
headImgUrl
;
}
public
void
setHeadImgUrl
(
String
headImgUrl
)
{
this
.
headImgUrl
=
headImgUrl
==
null
?
null
:
headImgUrl
.
trim
();
}
public
String
getAddress
()
{
return
address
;
}
public
void
setAddress
(
String
address
)
{
this
.
address
=
address
==
null
?
null
:
address
.
trim
();
}
public
String
getPatientAddress
()
{
return
patientAddress
;
}
public
void
setPatientAddress
(
String
patientAddress
)
{
this
.
patientAddress
=
patientAddress
==
null
?
null
:
patientAddress
.
trim
();
}
public
String
getTelephone
()
{
return
telephone
;
}
public
void
setTelephone
(
String
telephone
)
{
this
.
telephone
=
telephone
==
null
?
null
:
telephone
.
trim
();
}
public
String
getSocialCard
()
{
return
socialCard
;
}
public
void
setSocialCard
(
String
socialCard
)
{
this
.
socialCard
=
socialCard
==
null
?
null
:
socialCard
.
trim
();
}
public
String
getWorkUnit
()
{
return
workUnit
;
}
public
void
setWorkUnit
(
String
workUnit
)
{
this
.
workUnit
=
workUnit
==
null
?
null
:
workUnit
.
trim
();
}
public
String
getHealthFileNumber
()
{
return
healthFileNumber
;
}
public
void
setHealthFileNumber
(
String
healthFileNumber
)
{
this
.
healthFileNumber
=
healthFileNumber
==
null
?
null
:
healthFileNumber
.
trim
();
}
public
String
getPaymentType
()
{
return
paymentType
;
}
public
void
setPaymentType
(
String
paymentType
)
{
this
.
paymentType
=
paymentType
==
null
?
null
:
paymentType
.
trim
();
}
public
String
getRemarks
()
{
return
remarks
;
}
public
void
setRemarks
(
String
remarks
)
{
this
.
remarks
=
remarks
==
null
?
null
:
remarks
.
trim
();
}
public
String
getEmail
()
{
return
email
;
}
public
void
setEmail
(
String
email
)
{
this
.
email
=
email
==
null
?
null
:
email
.
trim
();
}
public
String
getNation
()
{
return
nation
;
}
public
void
setNation
(
String
nation
)
{
this
.
nation
=
nation
==
null
?
null
:
nation
.
trim
();
}
public
Integer
getCreateId
()
{
return
createId
;
}
public
void
setCreateId
(
Integer
createId
)
{
this
.
createId
=
createId
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Integer
getModifyId
()
{
return
modifyId
;
}
public
void
setModifyId
(
Integer
modifyId
)
{
this
.
modifyId
=
modifyId
;
}
public
Date
getModifyTime
()
{
return
modifyTime
;
}
public
void
setModifyTime
(
Date
modifyTime
)
{
this
.
modifyTime
=
modifyTime
;
}
public
int
getDeleteFlag
()
{
return
deleteFlag
;
}
public
void
setDeleteFlag
(
int
deleteFlag
)
{
this
.
deleteFlag
=
deleteFlag
;
}
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/account/account/server/entity/LoginResult.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
entity
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* Created on 2019/10/9 17:41
* author:crs
* Description: 登录状态返回
*/
@ApiModel
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
LoginResult
{
@ApiModelProperty
(
"token"
)
private
String
token
;
@ApiModelProperty
(
"用户id"
)
private
Long
userId
;
@ApiModelProperty
(
"是否绑定"
)
private
String
bindFlag
;
@ApiModelProperty
(
"联合登录id"
)
private
String
unionId
;
@ApiModelProperty
(
"是否完善过信息,1.信息未补全, 2信息已补全,3已补全密码"
)
private
int
entireFlag
;
public
String
getToken
()
{
return
token
;
}
public
void
setToken
(
String
token
)
{
this
.
token
=
token
;
}
public
Long
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
Long
userId
)
{
this
.
userId
=
userId
;
}
public
String
getBindFlag
()
{
return
bindFlag
;
}
public
void
setBindFlag
(
String
bindFlag
)
{
this
.
bindFlag
=
bindFlag
;
}
public
String
getUnionId
()
{
return
unionId
;
}
public
void
setUnionId
(
String
unionId
)
{
this
.
unionId
=
unionId
;
}
public
int
getEntireFlag
()
{
return
entireFlag
;
}
public
void
setEntireFlag
(
int
entireFlag
)
{
this
.
entireFlag
=
entireFlag
;
}
}
server/src/main/java/com/pica/cloud/account/account/server/entity/LoginResultWeb.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
entity
;
import
io.swagger.annotations.ApiModel
;
/**
* @author andong
* @create 2019/10/16
*/
@ApiModel
public
class
LoginResultWeb
{
private
int
certifyDoc
=
1
;
private
int
isExist
=
1
;
private
PICAPDoctor
picapDoctor
;
public
int
getCertifyDoc
()
{
return
certifyDoc
;
}
public
void
setCertifyDoc
(
int
certifyDoc
)
{
this
.
certifyDoc
=
certifyDoc
;
}
public
int
getIsExist
()
{
return
isExist
;
}
public
void
setIsExist
(
int
isExist
)
{
this
.
isExist
=
isExist
;
}
public
PICAPDoctor
getPicapDoctor
()
{
return
picapDoctor
;
}
public
void
setPicapDoctor
(
PICAPDoctor
picapDoctor
)
{
this
.
picapDoctor
=
picapDoctor
;
}
}
server/src/main/java/com/pica/cloud/account/account/server/entity/PICAPDoctor.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
entity
;
import
java.util.Date
;
/**
* @author andong
* @create 2019/10/16
*/
public
class
PICAPDoctor
{
private
Integer
id
;
private
Integer
sex
;
private
String
name
;
private
String
mobile_phone
;
private
Integer
status
;
private
Integer
type
;
private
Integer
hospital_id
;
private
Integer
department_id
;
private
Integer
title_id
;
private
String
cert_image_url
;
private
String
avatar_image_url
;
protected
Date
auth_time
;
protected
Date
rejected_time
;
private
String
honor
;
private
String
skills
;
private
String
card
;
private
Integer
thumb_up_num
;
private
String
email
;
private
String
qrcode
;
private
String
nickname
;
private
String
personal_sign
;
private
Integer
praise_num
;
private
String
password
;
private
String
gaoxueya_password
;
private
String
info
;
private
String
rank
;
private
Long
county
;
private
Long
city
;
private
Integer
province
;
private
String
hospital
;
private
String
department
;
private
String
title
;
private
String
invite_code
;
private
Integer
entire_flag
;
private
Integer
doctor_project_type
;
private
Integer
sms_send_num
;
private
Integer
total_sms_send_num
;
private
String
province_name
;
private
String
city_name
;
private
String
county_name
;
protected
Date
invite_start_time
;
private
Long
town
;
private
String
town_name
;
private
Integer
register_source
;
private
Integer
register_type
;
private
Integer
administer_title_id
;
private
String
administer_title
;
protected
Date
birthday
;
protected
String
birthdayStr
=
""
;
protected
Integer
age
=
0
;
protected
PICAPDoctorEducation
doctorEducation
;
private
Integer
delete_flag
;
private
Integer
creat_id
;
protected
Date
creat_time
;
private
Integer
modify_id
;
protected
Date
modify_time
;
private
Integer
create_id
;
protected
Date
create_time
;
public
Date
getBirthday
()
{
return
this
.
birthday
;
}
public
void
setBirthday
(
Date
birthday
)
{
this
.
birthday
=
birthday
;
}
public
Integer
getAge
()
{
return
this
.
age
;
}
public
void
setAge
(
Integer
age
)
{
this
.
age
=
age
;
}
public
String
getBirthdayStr
()
{
return
this
.
birthdayStr
;
}
public
void
setBirthdayStr
(
String
birthdayStr
)
{
this
.
birthdayStr
=
birthdayStr
;
}
public
String
getCard
()
{
return
this
.
card
;
}
public
void
setCard
(
String
card
)
{
this
.
card
=
card
;
}
public
PICAPDoctorEducation
getDoctorEducation
()
{
return
this
.
doctorEducation
;
}
public
void
setDoctorEducation
(
PICAPDoctorEducation
doctorEducation
)
{
this
.
doctorEducation
=
doctorEducation
;
}
public
Integer
getRegister_type
()
{
return
this
.
register_type
;
}
public
void
setRegister_type
(
Integer
register_type
)
{
this
.
register_type
=
register_type
;
}
public
String
getAdminister_title
()
{
return
this
.
administer_title
;
}
public
void
setAdminister_title
(
String
administer_title
)
{
this
.
administer_title
=
administer_title
;
}
public
Integer
getAdminister_title_id
()
{
return
this
.
administer_title_id
;
}
public
void
setAdminister_title_id
(
Integer
administer_title_id
)
{
this
.
administer_title_id
=
administer_title_id
;
}
public
Integer
getRegister_source
()
{
return
this
.
register_source
;
}
public
void
setRegister_source
(
Integer
register_source
)
{
this
.
register_source
=
register_source
;
}
public
Integer
getTotal_sms_send_num
()
{
return
this
.
total_sms_send_num
;
}
public
void
setTotal_sms_send_num
(
Integer
total_sms_send_num
)
{
this
.
total_sms_send_num
=
total_sms_send_num
;
}
public
Integer
getSms_send_num
()
{
return
this
.
sms_send_num
;
}
public
void
setSms_send_num
(
Integer
sms_send_num
)
{
this
.
sms_send_num
=
sms_send_num
;
}
public
Integer
getDoctor_project_type
()
{
return
this
.
doctor_project_type
;
}
public
void
setDoctor_project_type
(
Integer
doctor_project_type
)
{
this
.
doctor_project_type
=
doctor_project_type
;
}
public
String
getGaoxueya_password
()
{
return
this
.
gaoxueya_password
;
}
public
void
setGaoxueya_password
(
String
gaoxueya_password
)
{
this
.
gaoxueya_password
=
gaoxueya_password
;
}
public
String
getInvite_code
()
{
return
this
.
invite_code
;
}
public
void
setInvite_code
(
String
invite_code
)
{
this
.
invite_code
=
invite_code
;
}
public
Integer
getEntire_flag
()
{
return
this
.
entire_flag
;
}
public
void
setEntire_flag
(
Integer
entire_flag
)
{
this
.
entire_flag
=
entire_flag
;
}
public
Date
getAuth_time
()
{
return
this
.
auth_time
;
}
public
void
setAuth_time
(
Date
auth_time
)
{
this
.
auth_time
=
auth_time
;
}
public
Date
getRejected_time
()
{
return
this
.
rejected_time
;
}
public
void
setRejected_time
(
Date
rejected_time
)
{
this
.
rejected_time
=
rejected_time
;
}
public
Long
getCounty
()
{
return
this
.
county
;
}
public
void
setCounty
(
Long
county
)
{
this
.
county
=
county
;
}
public
Long
getCity
()
{
return
this
.
city
;
}
public
void
setCity
(
Long
city
)
{
this
.
city
=
city
;
}
public
Integer
getProvince
()
{
return
this
.
province
;
}
public
void
setProvince
(
Integer
province
)
{
this
.
province
=
province
;
}
public
String
getHospital
()
{
return
this
.
hospital
;
}
public
void
setHospital
(
String
hospital
)
{
this
.
hospital
=
hospital
;
}
public
String
getDepartment
()
{
return
this
.
department
;
}
public
void
setDepartment
(
String
department
)
{
this
.
department
=
department
;
}
public
String
getTitle
()
{
return
this
.
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
Integer
getId
()
{
return
this
.
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
Integer
getSex
()
{
return
this
.
sex
;
}
public
void
setSex
(
Integer
sex
)
{
this
.
sex
=
sex
;
}
public
String
getName
()
{
return
this
.
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getMobile_phone
()
{
return
this
.
mobile_phone
;
}
public
void
setMobile_phone
(
String
mobile_phone
)
{
this
.
mobile_phone
=
mobile_phone
;
}
public
Integer
getStatus
()
{
return
this
.
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
public
Integer
getType
()
{
return
this
.
type
;
}
public
void
setType
(
Integer
type
)
{
this
.
type
=
type
;
}
public
Integer
getHospital_id
()
{
return
this
.
hospital_id
;
}
public
void
setHospital_id
(
Integer
hospital_id
)
{
this
.
hospital_id
=
hospital_id
;
}
public
Integer
getDepartment_id
()
{
return
this
.
department_id
;
}
public
void
setDepartment_id
(
Integer
department_id
)
{
this
.
department_id
=
department_id
;
}
public
Integer
getTitle_id
()
{
return
this
.
title_id
;
}
public
void
setTitle_id
(
Integer
title_id
)
{
this
.
title_id
=
title_id
;
}
public
String
getCert_image_url
()
{
return
this
.
cert_image_url
;
}
public
void
setCert_image_url
(
String
cert_image_url
)
{
this
.
cert_image_url
=
cert_image_url
;
}
public
String
getAvatar_image_url
()
{
return
this
.
avatar_image_url
;
}
public
void
setAvatar_image_url
(
String
avatar_image_url
)
{
this
.
avatar_image_url
=
avatar_image_url
;
}
public
String
getHonor
()
{
return
this
.
honor
;
}
public
void
setHonor
(
String
honor
)
{
this
.
honor
=
honor
;
}
public
String
getSkills
()
{
return
this
.
skills
;
}
public
void
setSkills
(
String
skills
)
{
this
.
skills
=
skills
;
}
public
Integer
getThumb_up_num
()
{
return
this
.
thumb_up_num
;
}
public
void
setThumb_up_num
(
Integer
thumb_up_num
)
{
this
.
thumb_up_num
=
thumb_up_num
;
}
public
String
getEmail
()
{
return
this
.
email
;
}
public
void
setEmail
(
String
email
)
{
this
.
email
=
email
;
}
public
String
getQrcode
()
{
return
this
.
qrcode
;
}
public
void
setQrcode
(
String
qrcode
)
{
this
.
qrcode
=
qrcode
;
}
public
String
getNickname
()
{
return
this
.
nickname
;
}
public
void
setNickname
(
String
nickname
)
{
this
.
nickname
=
nickname
;
}
public
String
getPersonal_sign
()
{
return
this
.
personal_sign
;
}
public
void
setPersonal_sign
(
String
personal_sign
)
{
this
.
personal_sign
=
personal_sign
;
}
public
Integer
getPraise_num
()
{
return
this
.
praise_num
;
}
public
void
setPraise_num
(
Integer
praise_num
)
{
this
.
praise_num
=
praise_num
;
}
public
String
getPassword
()
{
return
this
.
password
;
}
public
void
setPassword
(
String
password
)
{
this
.
password
=
password
;
}
public
String
getInfo
()
{
return
this
.
info
;
}
public
void
setInfo
(
String
info
)
{
this
.
info
=
info
;
}
public
String
getRank
()
{
return
this
.
rank
;
}
public
void
setRank
(
String
rank
)
{
this
.
rank
=
rank
;
}
public
Date
getInvite_start_time
()
{
return
this
.
invite_start_time
;
}
public
void
setInvite_start_time
(
Date
invite_start_time
)
{
this
.
invite_start_time
=
invite_start_time
;
}
public
String
getProvince_name
()
{
return
this
.
province_name
;
}
public
void
setProvince_name
(
String
province_name
)
{
this
.
province_name
=
province_name
;
}
public
String
getCity_name
()
{
return
this
.
city_name
;
}
public
void
setCity_name
(
String
city_name
)
{
this
.
city_name
=
city_name
;
}
public
String
getCounty_name
()
{
return
this
.
county_name
;
}
public
void
setCounty_name
(
String
county_name
)
{
this
.
county_name
=
county_name
;
}
public
Long
getTown
()
{
return
this
.
town
;
}
public
void
setTown
(
Long
town
)
{
this
.
town
=
town
;
}
public
String
getTown_name
()
{
return
this
.
town_name
;
}
public
void
setTown_name
(
String
town_name
)
{
this
.
town_name
=
town_name
;
}
public
Integer
getCreate_id
()
{
return
this
.
create_id
;
}
public
void
setCreate_id
(
Integer
create_id
)
{
this
.
create_id
=
create_id
;
}
public
Date
getCreate_time
()
{
return
this
.
create_time
;
}
public
void
setCreate_time
(
Date
create_time
)
{
this
.
create_time
=
create_time
;
}
public
Integer
getDelete_flag
()
{
return
this
.
delete_flag
;
}
public
void
setDelete_flag
(
Integer
delete_flag
)
{
this
.
delete_flag
=
delete_flag
;
}
public
Integer
getCreat_id
()
{
return
this
.
creat_id
;
}
public
void
setCreat_id
(
Integer
creat_id
)
{
this
.
creat_id
=
creat_id
;
}
public
Date
getCreat_time
()
{
return
this
.
creat_time
;
}
public
void
setCreat_time
(
Date
creat_time
)
{
this
.
creat_time
=
creat_time
;
}
public
Integer
getModify_id
()
{
return
this
.
modify_id
;
}
public
void
setModify_id
(
Integer
modify_id
)
{
this
.
modify_id
=
modify_id
;
}
public
Date
getModify_time
()
{
return
this
.
modify_time
;
}
public
void
setModify_time
(
Date
modify_time
)
{
this
.
modify_time
=
modify_time
;
}
}
server/src/main/java/com/pica/cloud/account/account/server/entity/PICAPDoctorEducation.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
entity
;
import
java.util.Date
;
/**
* @author andong
* @create 2019/10/16
*/
public
class
PICAPDoctorEducation
{
private
static
final
long
serialVersionUID
=
1L
;
private
Integer
id
=
0
;
private
Integer
doctor_id
=
0
;
private
String
school_name
=
""
;
private
Integer
major_id
=
0
;
private
String
major_name
=
""
;
private
String
education_id
=
""
;
private
String
education_name
=
""
;
private
String
year
=
""
;
private
Integer
delete_flag
;
private
Integer
creat_id
;
protected
Date
creat_time
;
private
Integer
modify_id
;
protected
Date
modify_time
;
private
Integer
create_id
;
protected
Date
create_time
;
public
String
getMajor_name
()
{
return
this
.
major_name
;
}
public
void
setMajor_name
(
String
major_name
)
{
this
.
major_name
=
major_name
;
}
public
String
getEducation_name
()
{
return
this
.
education_name
;
}
public
void
setEducation_name
(
String
education_name
)
{
this
.
education_name
=
education_name
;
}
public
Integer
getId
()
{
return
this
.
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
Integer
getDoctor_id
()
{
return
this
.
doctor_id
;
}
public
void
setDoctor_id
(
Integer
doctor_id
)
{
this
.
doctor_id
=
doctor_id
;
}
public
String
getSchool_name
()
{
return
this
.
school_name
;
}
public
void
setSchool_name
(
String
school_name
)
{
this
.
school_name
=
school_name
;
}
public
Integer
getMajor_id
()
{
return
this
.
major_id
;
}
public
void
setMajor_id
(
Integer
major_id
)
{
this
.
major_id
=
major_id
;
}
public
String
getEducation_id
()
{
return
this
.
education_id
;
}
public
void
setEducation_id
(
String
education_id
)
{
this
.
education_id
=
education_id
;
}
public
String
getYear
()
{
return
this
.
year
;
}
public
void
setYear
(
String
year
)
{
this
.
year
=
year
;
}
public
Integer
getCreate_id
()
{
return
this
.
create_id
;
}
public
void
setCreate_id
(
Integer
create_id
)
{
this
.
create_id
=
create_id
;
}
public
Date
getCreate_time
()
{
return
this
.
create_time
;
}
public
void
setCreate_time
(
Date
create_time
)
{
this
.
create_time
=
create_time
;
}
public
Integer
getDelete_flag
()
{
return
this
.
delete_flag
;
}
public
void
setDelete_flag
(
Integer
delete_flag
)
{
this
.
delete_flag
=
delete_flag
;
}
public
Integer
getCreat_id
()
{
return
this
.
creat_id
;
}
public
void
setCreat_id
(
Integer
creat_id
)
{
this
.
creat_id
=
creat_id
;
}
public
Date
getCreat_time
()
{
return
this
.
creat_time
;
}
public
void
setCreat_time
(
Date
creat_time
)
{
this
.
creat_time
=
creat_time
;
}
public
Integer
getModify_id
()
{
return
this
.
modify_id
;
}
public
void
setModify_id
(
Integer
modify_id
)
{
this
.
modify_id
=
modify_id
;
}
public
Date
getModify_time
()
{
return
this
.
modify_time
;
}
public
void
setModify_time
(
Date
modify_time
)
{
this
.
modify_time
=
modify_time
;
}
}
server/src/main/java/com/pica/cloud/account/account/server/entity/WeChatEntity.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
entity
;
import
java.util.Date
;
public
class
WeChatEntity
{
/** 获取到的凭证 */
private
String
access_token
;
/** 凭证有效时间,单位:秒 */
private
int
expires_in
;
/** 用户刷新access_token */
private
String
refresh_token
;
/** 用户唯一标识,请注意,在未关注公众号时,用户访问公众号的网页,也会产生一个用户和公众号唯一的OpenID */
private
String
openid
;
/** 用户授权的作用域,使用逗号(,)分隔 */
private
String
scope
;
private
Date
createdAt
;
public
String
getAccess_token
()
{
return
access_token
;
}
public
void
setAccess_token
(
String
access_token
)
{
this
.
access_token
=
access_token
;
}
public
int
getExpires_in
()
{
return
expires_in
;
}
public
void
setExpires_in
(
int
expires_in
)
{
this
.
expires_in
=
expires_in
;
}
public
String
getRefresh_token
()
{
return
refresh_token
;
}
public
void
setRefresh_token
(
String
refresh_token
)
{
this
.
refresh_token
=
refresh_token
;
}
public
String
getOpenid
()
{
return
openid
;
}
public
void
setOpenid
(
String
openid
)
{
this
.
openid
=
openid
;
}
public
String
getScope
()
{
return
scope
;
}
public
void
setScope
(
String
scope
)
{
this
.
scope
=
scope
;
}
public
Date
getCreatedAt
()
{
return
createdAt
;
}
public
void
setCreatedAt
(
Date
createdAt
)
{
this
.
createdAt
=
createdAt
;
}
}
server/src/main/java/com/pica/cloud/account/account/server/entity/WeChatUserInfoEntity.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
entity
;
import
java.util.Date
;
public
class
WeChatUserInfoEntity
{
/** 是否订阅该公众号标识 */
private
Integer
subscribe
;
/** 用户标识 */
private
String
openid
;
/** 昵称 */
private
String
nickname
;
/** 性别 */
private
Integer
sex
;
/** 用户所在城市 */
private
String
city
;
/** 用户所在省份 */
private
String
province
;
/** 国家*/
private
String
country
;
/** 用户的语言 */
private
String
language
;
/** 用户头像 */
private
String
headimgurl
;
/** 用户关注时间 */
private
Date
subscribe_time
;
/** 只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段 */
private
String
unionid
;
private
String
remark
;
private
Integer
groupid
;
private
String
tagid_list
;
private
String
privilege
;
public
Integer
getSubscribe
()
{
return
subscribe
;
}
public
void
setSubscribe
(
Integer
subscribe
)
{
this
.
subscribe
=
subscribe
;
}
public
String
getOpenid
()
{
return
openid
;
}
public
void
setOpenid
(
String
openid
)
{
this
.
openid
=
openid
;
}
public
String
getNickname
()
{
return
nickname
;
}
public
void
setNickname
(
String
nickname
)
{
this
.
nickname
=
nickname
;
}
public
Integer
getSex
()
{
return
sex
;
}
public
void
setSex
(
Integer
sex
)
{
this
.
sex
=
sex
;
}
public
String
getCity
()
{
return
city
;
}
public
void
setCity
(
String
city
)
{
this
.
city
=
city
;
}
public
String
getProvince
()
{
return
province
;
}
public
void
setProvince
(
String
province
)
{
this
.
province
=
province
;
}
public
String
getCountry
()
{
return
country
;
}
public
void
setCountry
(
String
country
)
{
this
.
country
=
country
;
}
public
String
getLanguage
()
{
return
language
;
}
public
void
setLanguage
(
String
language
)
{
this
.
language
=
language
;
}
public
String
getHeadimgurl
()
{
return
headimgurl
;
}
public
void
setHeadimgurl
(
String
headimgurl
)
{
this
.
headimgurl
=
headimgurl
;
}
public
Date
getSubscribe_time
()
{
return
subscribe_time
;
}
public
void
setSubscribe_time
(
Date
subscribe_time
)
{
this
.
subscribe_time
=
subscribe_time
;
}
public
String
getUnionid
()
{
return
unionid
;
}
public
void
setUnionid
(
String
unionid
)
{
this
.
unionid
=
unionid
;
}
public
String
getRemark
()
{
return
remark
;
}
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
public
Integer
getGroupid
()
{
return
groupid
;
}
public
void
setGroupid
(
Integer
groupid
)
{
this
.
groupid
=
groupid
;
}
public
String
getTagid_list
()
{
return
tagid_list
;
}
public
void
setTagid_list
(
String
tagid_list
)
{
this
.
tagid_list
=
tagid_list
;
}
public
String
getPrivilege
()
{
return
privilege
;
}
public
void
setPrivilege
(
String
privilege
)
{
this
.
privilege
=
privilege
;
}
}
server/src/main/java/com/pica/cloud/account/account/server/enums/AccountAgreementEnum.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
enums
;
/**
* Created on 2019/10/11 19:08
* author:crs
* Description:账户协议类型
*/
public
enum
AccountAgreementEnum
{
USER_AGREEMENT
(
1
,
"用户协议"
),
PRIVACY_AGREEMENT
(
5
,
"隐私协议"
);
private
int
code
;
private
String
desc
;
AccountAgreementEnum
(
int
code
,
String
desc
)
{
this
.
code
=
code
;
this
.
desc
=
desc
;
}
public
int
getCode
()
{
return
code
;
}
public
void
setCode
(
int
code
)
{
this
.
code
=
code
;
}
}
server/src/main/java/com/pica/cloud/account/account/server/enums/AccountExceptionEnum.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
enums
;
/**
* Created on 2019/8/27
* author:crs
* Description:账户常用异常类型定义
*/
public
enum
AccountExceptionEnum
{
PICA_NOT_EMPTY
(
"216501"
,
"字段非空提示信息"
),
PICA_MOBILE_ERROR
(
"216502"
,
"请输入正确的手机号"
),
PICA_SYSCODE_ERROR
(
"216503"
,
"短信验证码错误"
),
PICA_SYSCODE_EXPIRE
(
"216504"
,
"短信验证码已过期,请重新获取"
),
PICA_SYSCODE_RESET
(
"216505"
,
"请X秒后重试(获取验证码),请重新获取"
),
PICA_SYSCODE_LATER
(
"216506"
,
"验证码获取过于频繁,请隔天后重试"
),
PICA_ALREADY_REGISTER
(
"216507"
,
"该手机号已注册,请直接登录"
),
PICA_NOT_REGISTER
(
"216508"
,
"未注册,请先注册"
),
PICA_PASSWORD_ERROR
(
"216509"
,
"请输入正确的密码"
),
PICA_IMAGE_PASSWORD_ERROR
(
"216511"
,
"图形验证码错误"
),
PICA_LOGIN_AGAIN
(
"216512"
,
"请重新登录"
),
PICA_PASSWORD_NULL
(
"216513"
,
"密码不能为空"
),
PICA_PASSWORD_EQUAL
(
"216514"
,
"旧密码与新密码不能相同"
),
PICA_UNBIND_MOBILE
(
"216515"
,
"该手机号未绑定微信"
),
PICA_MOBILE_SAME
(
"216516"
,
"新手机号与旧手机号不能相同"
),
PICA_PARAMS_ERROR
(
"216517"
,
"传递参数有误"
),
PICA_SYSCODE_RETRY
(
"216518"
,
"请X秒后重试"
),
PICA_NOT_EXIST
(
"216519"
,
"该用户不存在"
),
PICA_REGISTER_FAIL
(
"216520"
,
"注册失败"
);
private
String
code
;
private
String
message
;
AccountExceptionEnum
(
String
code
,
String
message
)
{
this
.
code
=
code
;
this
.
message
=
message
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getMessage
()
{
return
message
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
}
}
server/src/main/java/com/pica/cloud/account/account/server/enums/AccountTypeEnum.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
enums
;
/**
* Created on 2019/8/27
* author:crs
* Description:账户常用枚举类型
*/
public
enum
AccountTypeEnum
{
//登录类型枚举(记录登录日志时使用)
LOGIN_CODE
(
1
,
"验证码登录"
),
LOGIN_PWD
(
2
,
"密码登录"
),
LOGIN_WE_CHAT
(
3
,
"微信登录"
),
LOGIN_OUT
(
4
,
"退出登录"
),
LOGIN_REGISTER
(
5
,
"注册登录"
),
//登录态相关枚举
LOGIN_STATUS_SUCCESS
(
1
,
"登录成功"
),
LOGIN_STATUS_FAILURE
(
2
,
"登录失败"
),
//产品来源相关枚举
PRODUCT_TYPE_DOCTOR
(
1
,
"云鹊医产品系"
),
PRODUCT_TYPE_HEALTH
(
2
,
"云鹊健康产品系"
),
//终端类型
DEVICE_TYPE_ANDROID
(
1
,
"安卓"
),
DEVICE_TYPE_IOS
(
2
,
"ios"
),
DEVICE_TYPE_WEB
(
3
,
"web"
),
DEVICE_TYPE_H5
(
4
,
"H5"
),
DEVICE_TYPE_ADMIN
(
5
,
"admin"
),
//验证码获取类型: flag:0登录(默认)1注册 2微信登录绑定手机 3修改手机 4重置密码
SYSCODE_TYPE_LOGIN
(
0
,
"登录"
),
SYSCODE_TYPE_REGISTER
(
1
,
"注册"
),
SYSCODE_TYPE_WE_CHAT
(
2
,
"微信登录绑定手机"
),
SYSCODE_TYPE_MODIFY_MOBILE
(
3
,
"修改手机号"
),
SYSCODE_TYPE_RESET_PASSWORD
(
4
,
"重置密码"
),
//联合登录类型
UNION_LOGIN_WE_CHAT
(
1
,
"微信"
),
UNION_LOGIN_QQ
(
2
,
"QQ"
),
union_login_blog
(
3
,
"微博"
),
//微信绑定状态
BIND_STATUS_SUCCESS
(
1
,
"已绑定"
),
BIND_STATUS_FAILURE
(
0
,
"未绑定"
),
//日志类型枚举
LOG_TYPE_LOGIN
(
1
,
"登录日志"
),
LOG_TYPE_PASSWORD
(
2
,
"密码更新日志"
),
LOG_TYPE_USER_INFO
(
3
,
"用户信息更新日志"
);
private
int
code
;
private
String
type
;
AccountTypeEnum
(
int
code
,
String
type
)
{
this
.
code
=
code
;
this
.
type
=
type
;
}
public
int
getCode
()
{
return
code
;
}
public
void
setCode
(
int
code
)
{
this
.
code
=
code
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
}
server/src/main/java/com/pica/cloud/account/account/server/exception/AccountException.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
exception
;
import
com.pica.cloud.account.account.server.enums.AccountExceptionEnum
;
import
com.pica.cloud.foundation.entity.PicaException
;
import
com.pica.cloud.foundation.entity.PicaResultCode
;
/**
* Created on 2019/9/2
* author:crs
* Description:账户异常基类定义
*/
public
class
AccountException
extends
PicaException
{
public
AccountException
(
String
code
,
String
msg
)
{
super
(
code
,
msg
);
}
public
AccountException
(
PicaResultCode
picaResultCode
)
{
super
(
picaResultCode
);
}
public
AccountException
(
AccountExceptionEnum
exceptionType
)
{
super
(
exceptionType
.
getCode
(),
exceptionType
.
getMessage
());
}
}
server/src/main/java/com/pica/cloud/account/account/server/log/AccountLogEntity.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
log
;
/**
* Created on 2019/08/27
* author:crs
* Description:日志模型父类,主要用于定义日志模型
*/
public
class
AccountLogEntity
{
//标记当前记录的是哪种日志
private
int
logType
;
public
int
getLogType
()
{
return
logType
;
}
public
void
setLogType
(
int
logType
)
{
this
.
logType
=
logType
;
}
}
server/src/main/java/com/pica/cloud/account/account/server/log/AccountLogEntityUtils.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
log
;
import
com.pica.cloud.account.account.server.entity.LogLoginEntity
;
import
com.pica.cloud.account.account.server.entity.LogPWDModifyEntity
;
import
java.util.Date
;
/**
* Created on 2019/08/27
* author:crs
* Description:主要用于帮助创建pojo
*/
public
class
AccountLogEntityUtils
{
/**
* 获取登录日志实例
*
* @param acctId
* @param productType
* @param sourceType
* @return
*/
public
static
LogLoginEntity
getLogLoginEntity
(
Integer
acctId
,
Integer
productType
,
Integer
sourceType
,
int
code
,
String
ipAddr
,
int
code1
,
int
code2
)
{
LogLoginEntity
entity
=
new
LogLoginEntity
();
Date
currentTime
=
new
Date
();
entity
.
setAcctId
(
acctId
);
entity
.
setCreateId
(
acctId
);
entity
.
setCreateTime
(
currentTime
);
entity
.
setModifyId
(
acctId
);
entity
.
setModifyTime
(
currentTime
);
entity
.
setDeleteFlag
(
1
);
entity
.
setLoginTime
(
currentTime
);
entity
.
setProductType
(
productType
);
entity
.
setSourceType
(
sourceType
);
entity
.
setLoginType
(
code
);
entity
.
setLoginIp
(
ipAddr
);
entity
.
setLoginStatus
(
code1
);
entity
.
setLogType
(
code2
);
return
entity
;
}
/**
* 获取密码修改实例
*
* @param acctId
* @return
*/
public
static
LogPWDModifyEntity
getLogPWDModifyEntity
(
Integer
acctId
,
String
mobile
,
String
oldpwd
,
String
newPwd
,
Integer
logType
)
{
LogPWDModifyEntity
entity
=
new
LogPWDModifyEntity
();
Date
currentTime
=
new
Date
();
entity
.
setCreatedId
(
acctId
);
entity
.
setCreatedTime
(
currentTime
);
entity
.
setDeleteFlag
(
1
);
entity
.
setModifiedId
(
acctId
);
entity
.
setModifiedTime
(
currentTime
);
entity
.
setMobilePhone
(
mobile
);
entity
.
setOldPwd
(
oldpwd
);
entity
.
setNewPwd
(
newPwd
);
entity
.
setLogType
(
logType
);
return
entity
;
}
}
server/src/main/java/com/pica/cloud/account/account/server/log/AccountLogTask.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
log
;
import
com.pica.cloud.account.account.server.entity.LogLoginEntity
;
import
com.pica.cloud.account.account.server.entity.LogPWDModifyEntity
;
import
com.pica.cloud.account.account.server.entity.LogUserInfoEntity
;
import
com.pica.cloud.account.account.server.enums.AccountTypeEnum
;
import
com.pica.cloud.account.account.server.mapper.LogLoginMapper
;
import
com.pica.cloud.account.account.server.mapper.LogPWDModifyMapper
;
import
com.pica.cloud.account.account.server.mapper.LogUserInfoMapper
;
import
com.pica.cloud.account.account.server.util.BeanUtil
;
/**
* Created on 2019/08/27
* author:crs
* Description:异步任务处理日志记录
*/
public
class
AccountLogTask
implements
Runnable
{
private
LogLoginMapper
loginLogMapper
;
private
LogPWDModifyMapper
logPWDModifyMapper
;
private
LogUserInfoMapper
logUserInfoMapper
;
/**
* 日志类型
*/
private
int
type
;
/**
* 日志内容
*/
private
AccountLogEntity
picaLogEntity
;
AccountLogTask
(
AccountLogEntity
picaLogEntity
)
{
this
.
picaLogEntity
=
picaLogEntity
;
type
=
picaLogEntity
.
getLogType
();
loginLogMapper
=
BeanUtil
.
getBean
(
LogLoginMapper
.
class
);
logPWDModifyMapper
=
BeanUtil
.
getBean
(
LogPWDModifyMapper
.
class
);
logUserInfoMapper
=
BeanUtil
.
getBean
(
LogUserInfoMapper
.
class
);
}
@Override
public
void
run
()
{
if
(
type
==
AccountTypeEnum
.
LOG_TYPE_LOGIN
.
getCode
())
{
loginLogMapper
.
insertSelective
((
LogLoginEntity
)
picaLogEntity
);
}
else
if
(
type
==
AccountTypeEnum
.
LOG_TYPE_PASSWORD
.
getCode
())
{
logPWDModifyMapper
.
insert
((
LogPWDModifyEntity
)
picaLogEntity
);
}
else
if
(
type
==
AccountTypeEnum
.
LOG_TYPE_USER_INFO
.
getCode
())
{
logUserInfoMapper
.
insertSelective
((
LogUserInfoEntity
)
picaLogEntity
);
}
}
}
server/src/main/java/com/pica/cloud/account/account/server/log/AccountLogUtils.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
log
;
import
com.pica.cloud.account.account.server.util.ExecutorServiceUtils
;
import
org.springframework.stereotype.Component
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
/**
* Created on 2019/08/27
* author:crs
* Description:日志操作工具类
*/
@Component
public
class
AccountLogUtils
{
/**
* 日志记录方法
*
* @param accountLogEntity
*/
public
void
info
(
AccountLogEntity
accountLogEntity
)
{
ExecutorServiceUtils
.
getExecutor
().
submit
(
new
AccountLogTask
(
accountLogEntity
));
}
}
server/src/main/java/com/pica/cloud/account/account/server/mapper/AccountInfoDetailMapper.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
mapper
;
import
com.pica.cloud.account.account.server.entity.AccountInfoEntity
;
public
interface
AccountInfoDetailMapper
{
/**
* 通过电话号码查询账号信息
*
* @param mobile
* @return
*/
AccountInfoEntity
selectByMobile
(
String
mobile
);
/**
* 插入注册人信息
*
* @param acctId
*/
void
updateCreateInfo
(
int
acctId
);
/**
* 修改手机号
*
* @param record
* @return
*/
void
updateMobileByPrimaryKey
(
AccountInfoEntity
record
);
/**
* 修改用户密码
*
* @param record
* @return
*/
void
updatePasswordByPrimaryKey
(
AccountInfoEntity
record
);
AccountInfoEntity
selectByPrimaryKey
(
Integer
id
);
int
updateByPrimaryKeySelective
(
AccountInfoEntity
record
);
int
updateByPrimaryKey
(
AccountInfoEntity
record
);
int
deleteByPrimaryKey
(
Integer
id
);
int
insert
(
AccountInfoEntity
record
);
int
insertSelective
(
AccountInfoEntity
record
);
}
server/src/main/java/com/pica/cloud/account/account/server/mapper/AccountPatientInfoMapper.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
mapper
;
import
com.pica.cloud.account.account.server.entity.AccountPatientInfoEntity
;
public
interface
AccountPatientInfoMapper
{
/**
* 通过userId查询居民信息
*
* @param id userId
* @return
*/
AccountPatientInfoEntity
selectByPrimaryKey
(
Integer
id
);
/**
* 通过用户id查询居民信息
*
* @param id 用户id
* @return
*/
AccountPatientInfoEntity
selectByUserId
(
Integer
id
);
/**
* 通过账户id查询账户信息
*
* @param acctId
* @return
*/
AccountPatientInfoEntity
selectByAcctId
(
Integer
acctId
);
/**
* 更新居民信息接口
*
* @param record 居民信息模型
* @return
*/
int
updateByPrimaryKeySelective
(
AccountPatientInfoEntity
record
);
int
insertSelective
(
AccountPatientInfoEntity
record
);
int
updateByPrimaryKey
(
AccountPatientInfoEntity
record
);
int
deleteByPrimaryKey
(
Integer
id
);
int
insert
(
AccountPatientInfoEntity
record
);
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/account/account/server/mapper/AccountUnionMapper.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
mapper
;
import
com.pica.cloud.account.account.server.entity.AccountUnionEntity
;
public
interface
AccountUnionMapper
{
/**
* 解除绑定关系
*
* @param acctId 账户id
* @return
*/
int
updateUnbindByAcctId
(
Integer
acctId
);
/**
* 是否绑定过手机号
*
* @param unionId 联合id
* @return
*/
AccountUnionEntity
selectByUnionId
(
String
unionId
);
int
deleteByPrimaryKey
(
Integer
id
);
int
insert
(
AccountUnionEntity
record
);
int
insertSelective
(
AccountUnionEntity
record
);
AccountUnionEntity
selectByPrimaryKey
(
Integer
id
);
int
updateByPrimaryKeySelective
(
AccountUnionEntity
record
);
int
updateByPrimaryKey
(
AccountUnionEntity
record
);
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/account/account/server/mapper/AccountWeChatInfoMapper.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
mapper
;
import
com.pica.cloud.account.account.server.entity.AccountWeChatInfoEntity
;
public
interface
AccountWeChatInfoMapper
{
/**
* UnionId 是否存在
* @param id 联合id
* @return
*/
AccountWeChatInfoEntity
selectByUnionId
(
String
id
);
int
deleteByPrimaryKey
(
Integer
id
);
int
insert
(
AccountWeChatInfoEntity
record
);
int
insertSelective
(
AccountWeChatInfoEntity
record
);
AccountWeChatInfoEntity
selectByPrimaryKey
(
Integer
id
);
int
updateByPrimaryKeySelective
(
AccountWeChatInfoEntity
record
);
int
updateByPrimaryKey
(
AccountWeChatInfoEntity
record
);
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/account/account/server/mapper/AgreementEntityMapper.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
mapper
;
import
com.pica.cloud.account.account.server.entity.AgreementEntity
;
public
interface
AgreementEntityMapper
{
int
deleteByPrimaryKey
(
Long
id
);
int
insert
(
AgreementEntity
record
);
int
insertSelective
(
AgreementEntity
record
);
AgreementEntity
selectByPrimaryKey
(
Long
id
);
/**
* 根据协议类型查询协议
*
* @param agreementType
* @return
*/
Integer
selectByType
(
int
agreementType
);
int
updateByPrimaryKeySelective
(
AgreementEntity
record
);
int
updateByPrimaryKeyWithBLOBs
(
AgreementEntity
record
);
int
updateByPrimaryKey
(
AgreementEntity
record
);
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/account/account/server/mapper/AgreementLogEntityMapper.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
mapper
;
import
com.pica.cloud.account.account.server.entity.AgreementLogEntity
;
public
interface
AgreementLogEntityMapper
{
int
deleteByPrimaryKey
(
Long
id
);
int
insert
(
AgreementLogEntity
record
);
int
insertSelective
(
AgreementLogEntity
record
);
AgreementLogEntity
selectByPrimaryKey
(
Long
id
);
int
updateByPrimaryKeySelective
(
AgreementLogEntity
record
);
int
updateByPrimaryKey
(
AgreementLogEntity
record
);
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/account/account/server/mapper/DoctorMapper.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
mapper
;
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
org.apache.ibatis.annotations.Param
;
public
interface
DoctorMapper
{
/**
* 获取医生信息
*
* @param mobile 手机号
* @return
*/
Doctor
getDoctorInfoByMobile
(
String
mobile
);
/**
* 通过账户信息查询用户id
*
* @param acctId
* @return
*/
Long
selectUserIdByAcctId
(
Integer
acctId
);
/**
* 通过id获取医生信息
*
* @param id
* @return
*/
Doctor
selectByPrimaryKey
(
Integer
id
);
/**
* 更新医生信息
*
* @param record
* @return
*/
int
updateByPrimaryKeySelective
(
Doctor
record
);
/**
* 通过账户id更新用户信息
* @param doctor
*/
void
updateByAcctId
(
Doctor
doctor
);
int
deleteByPrimaryKey
(
Integer
id
);
int
insert
(
Doctor
record
);
int
insertSelective
(
Doctor
record
);
int
updateByPrimaryKey
(
Doctor
record
);
/**
* 绑定微信
* @param acctId
* @param unionId
* @return
*/
int
bindWeChat
(
@Param
(
"acctId"
)
int
acctId
,
@Param
(
"unionId"
)
String
unionId
);
/**
* 解绑微信
* @param acctId
* @return
*/
int
unbindWeChat
(
@Param
(
"acctId"
)
int
acctId
);
PICAPDoctor
queryDoctor
(
long
doctorId
);
/**
* 通过手机号获取用户id
* @param mobile
* @return
*/
//Long selectDoctorIdByMobile(String mobile);
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/account/account/server/mapper/LogLoginMapper.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
mapper
;
import
com.pica.cloud.account.account.server.entity.LogLoginEntity
;
public
interface
LogLoginMapper
{
int
deleteByPrimaryKey
(
Integer
id
);
int
insert
(
LogLoginEntity
record
);
int
insertSelective
(
LogLoginEntity
record
);
LogLoginEntity
selectByPrimaryKey
(
Integer
id
);
int
updateByPrimaryKeySelective
(
LogLoginEntity
record
);
int
updateByPrimaryKey
(
LogLoginEntity
record
);
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/account/account/server/mapper/LogPWDModifyMapper.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
mapper
;
import
com.pica.cloud.account.account.server.entity.LogPWDModifyEntity
;
public
interface
LogPWDModifyMapper
{
int
deleteByPrimaryKey
(
Integer
id
);
int
insert
(
LogPWDModifyEntity
record
);
int
insertSelective
(
LogPWDModifyEntity
record
);
LogPWDModifyEntity
selectByPrimaryKey
(
Integer
id
);
int
updateByPrimaryKeySelective
(
LogPWDModifyEntity
record
);
int
updateByPrimaryKey
(
LogPWDModifyEntity
record
);
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/account/account/server/mapper/LogUserInfoMapper.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
mapper
;
import
com.pica.cloud.account.account.server.entity.LogUserInfoEntity
;
public
interface
LogUserInfoMapper
{
int
deleteByPrimaryKey
(
Integer
id
);
int
insert
(
LogUserInfoEntity
record
);
int
insertSelective
(
LogUserInfoEntity
record
);
LogUserInfoEntity
selectByPrimaryKey
(
Integer
id
);
int
updateByPrimaryKeySelective
(
LogUserInfoEntity
record
);
int
updateByPrimaryKey
(
LogUserInfoEntity
record
);
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/account/account/server/queue/QueueConfig.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
queue
;
import
org.springframework.amqp.core.*
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
/**
* Created on 2019/9/11 17:27
* author:crs
* Description:消息队列配置
*/
@Configuration
public
class
QueueConfig
{
public
final
static
String
QUEUE_NAME
=
"register_queue_account_13201"
;
public
final
static
String
EXCHANGE_NAME
=
"register_exchange"
;
public
final
static
String
ROUTE_KEY_NAME
=
"register_finish"
;
/**
* 创建一个消息队列
*
* @return
*/
@Bean
public
Queue
queue
()
{
return
new
Queue
(
QUEUE_NAME
,
true
,
false
,
true
);
}
/**
* 创建交换机
*
* @return
*/
@Bean
public
TopicExchange
directExchange
()
{
return
new
TopicExchange
(
EXCHANGE_NAME
);
}
/**
* 把消息队里和交换机进行绑定
*
* @return
*/
@Bean
public
Binding
binding
()
{
return
BindingBuilder
.
bind
(
queue
()).
to
(
directExchange
()).
with
(
ROUTE_KEY_NAME
);
}
}
server/src/main/java/com/pica/cloud/account/account/server/queue/QueueProducer.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
queue
;
import
org.springframework.amqp.core.AmqpTemplate
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
/**
* Created on 2019/9/11 17:37
* author:crs
* Description:消息生产者
*/
@Component
public
class
QueueProducer
{
@Autowired
private
AmqpTemplate
amqpTemplate
;
/**
* 发送消息
*
* @param message
*/
public
void
send
(
byte
[]
message
)
{
amqpTemplate
.
convertAndSend
(
QueueConfig
.
EXCHANGE_NAME
,
QueueConfig
.
ROUTE_KEY_NAME
,
message
);
}
}
server/src/main/java/com/pica/cloud/account/account/server/req/BaseRequest.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
req
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* Created on 2019/8/27
* author:crs
* Description:请求参数封装类
*/
@ApiModel
public
class
BaseRequest
{
@ApiModelProperty
(
"账户id"
)
private
Integer
accId
;
private
String
mobile
;
private
String
password
;
@ApiModelProperty
(
"旧密码"
)
private
String
oldPwd
;
private
String
authCode
;
private
int
flag
;
@ApiModelProperty
(
"产品线类型"
)
private
int
productType
;
@ApiModelProperty
(
"渠道来源"
)
private
int
sourceType
;
@ApiModelProperty
(
"登录ip"
)
private
String
loginIp
;
@ApiModelProperty
(
"联合id"
)
private
String
unionId
;
@ApiModelProperty
(
"微信code"
)
private
String
weChatCode
;
@ApiModelProperty
(
"微信登录类型"
)
private
Integer
weChatLoginType
;
@ApiModelProperty
(
"图片验证码token"
)
private
String
captchaToken
;
@ApiModelProperty
(
"图片验证码答案"
)
private
String
captchaAnswer
;
public
String
getCaptchaToken
()
{
return
captchaToken
;
}
public
void
setCaptchaToken
(
String
captchaToken
)
{
this
.
captchaToken
=
captchaToken
;
}
public
String
getCaptchaAnswer
()
{
return
captchaAnswer
;
}
public
void
setCaptchaAnswer
(
String
captchaAnswer
)
{
this
.
captchaAnswer
=
captchaAnswer
;
}
public
Integer
getAccId
()
{
return
accId
;
}
public
void
setAccId
(
Integer
accId
)
{
this
.
accId
=
accId
;
}
public
String
getMobile
()
{
return
mobile
;
}
public
void
setMobile
(
String
mobile
)
{
this
.
mobile
=
mobile
;
}
public
String
getPassword
()
{
return
password
;
}
public
void
setPassword
(
String
password
)
{
this
.
password
=
password
;
}
public
String
getOldPwd
()
{
return
oldPwd
;
}
public
void
setOldPwd
(
String
oldPwd
)
{
this
.
oldPwd
=
oldPwd
;
}
public
String
getAuthCode
()
{
return
authCode
;
}
public
void
setAuthCode
(
String
authCode
)
{
this
.
authCode
=
authCode
;
}
public
int
getFlag
()
{
return
flag
;
}
public
void
setFlag
(
int
flag
)
{
this
.
flag
=
flag
;
}
public
int
getProductType
()
{
return
productType
;
}
public
void
setProductType
(
int
productType
)
{
this
.
productType
=
productType
;
}
public
int
getSourceType
()
{
return
sourceType
;
}
public
void
setSourceType
(
int
sourceType
)
{
this
.
sourceType
=
sourceType
;
}
public
String
getLoginIp
()
{
return
loginIp
;
}
public
void
setLoginIp
(
String
loginIp
)
{
this
.
loginIp
=
loginIp
;
}
public
String
getUnionId
()
{
return
unionId
;
}
public
void
setUnionId
(
String
unionId
)
{
this
.
unionId
=
unionId
;
}
public
String
getWeChatCode
()
{
return
weChatCode
;
}
public
void
setWeChatCode
(
String
weChatCode
)
{
this
.
weChatCode
=
weChatCode
;
}
public
Integer
getWeChatLoginType
()
{
return
weChatLoginType
;
}
public
void
setWeChatLoginType
(
Integer
weChatLoginType
)
{
this
.
weChatLoginType
=
weChatLoginType
;
}
}
server/src/main/java/com/pica/cloud/account/account/server/req/PatientReq.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
req
;
import
java.util.Date
;
/**
* Created on 2019/09/02
* author:crs
* Description:居民信息类
*/
public
class
PatientReq
{
private
Integer
id
;
private
Integer
acctId
;
private
String
villageName
;
private
Long
villageId
;
private
String
townName
;
private
Long
townId
;
private
String
countyName
;
private
Long
countyId
;
private
String
cityName
;
private
Long
cityId
;
private
String
provinceName
;
private
Long
provinceId
;
private
Long
country
;
private
String
headImgUrl
;
private
String
address
;
private
String
patientAddress
;
private
String
telephone
;
private
String
socialCard
;
private
String
workUnit
;
private
String
healthFileNumber
;
private
String
paymentType
;
private
String
remarks
;
private
String
email
;
private
String
nation
;
private
Integer
createId
;
private
Date
createTime
;
private
Integer
modifyId
;
private
Date
modifyTime
;
private
int
deleteFlag
;
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
String
getVillageName
()
{
return
villageName
;
}
public
void
setVillageName
(
String
villageName
)
{
this
.
villageName
=
villageName
;
}
public
Long
getVillageId
()
{
return
villageId
;
}
public
void
setVillageId
(
Long
villageId
)
{
this
.
villageId
=
villageId
;
}
public
String
getTownName
()
{
return
townName
;
}
public
void
setTownName
(
String
townName
)
{
this
.
townName
=
townName
;
}
public
Long
getTownId
()
{
return
townId
;
}
public
void
setTownId
(
Long
townId
)
{
this
.
townId
=
townId
;
}
public
String
getCountyName
()
{
return
countyName
;
}
public
void
setCountyName
(
String
countyName
)
{
this
.
countyName
=
countyName
;
}
public
Long
getCountyId
()
{
return
countyId
;
}
public
void
setCountyId
(
Long
countyId
)
{
this
.
countyId
=
countyId
;
}
public
String
getCityName
()
{
return
cityName
;
}
public
void
setCityName
(
String
cityName
)
{
this
.
cityName
=
cityName
;
}
public
Long
getCityId
()
{
return
cityId
;
}
public
void
setCityId
(
Long
cityId
)
{
this
.
cityId
=
cityId
;
}
public
String
getProvinceName
()
{
return
provinceName
;
}
public
void
setProvinceName
(
String
provinceName
)
{
this
.
provinceName
=
provinceName
;
}
public
Long
getProvinceId
()
{
return
provinceId
;
}
public
void
setProvinceId
(
Long
provinceId
)
{
this
.
provinceId
=
provinceId
;
}
public
Long
getCountry
()
{
return
country
;
}
public
void
setCountry
(
Long
country
)
{
this
.
country
=
country
;
}
public
String
getHeadImgUrl
()
{
return
headImgUrl
;
}
public
void
setHeadImgUrl
(
String
headImgUrl
)
{
this
.
headImgUrl
=
headImgUrl
;
}
public
String
getAddress
()
{
return
address
;
}
public
void
setAddress
(
String
address
)
{
this
.
address
=
address
;
}
public
String
getPatientAddress
()
{
return
patientAddress
;
}
public
void
setPatientAddress
(
String
patientAddress
)
{
this
.
patientAddress
=
patientAddress
;
}
public
String
getTelephone
()
{
return
telephone
;
}
public
void
setTelephone
(
String
telephone
)
{
this
.
telephone
=
telephone
;
}
public
String
getSocialCard
()
{
return
socialCard
;
}
public
void
setSocialCard
(
String
socialCard
)
{
this
.
socialCard
=
socialCard
;
}
public
String
getWorkUnit
()
{
return
workUnit
;
}
public
void
setWorkUnit
(
String
workUnit
)
{
this
.
workUnit
=
workUnit
;
}
public
String
getHealthFileNumber
()
{
return
healthFileNumber
;
}
public
void
setHealthFileNumber
(
String
healthFileNumber
)
{
this
.
healthFileNumber
=
healthFileNumber
;
}
public
String
getPaymentType
()
{
return
paymentType
;
}
public
void
setPaymentType
(
String
paymentType
)
{
this
.
paymentType
=
paymentType
;
}
public
String
getRemarks
()
{
return
remarks
;
}
public
void
setRemarks
(
String
remarks
)
{
this
.
remarks
=
remarks
;
}
public
String
getEmail
()
{
return
email
;
}
public
void
setEmail
(
String
email
)
{
this
.
email
=
email
;
}
public
String
getNation
()
{
return
nation
;
}
public
void
setNation
(
String
nation
)
{
this
.
nation
=
nation
;
}
public
Integer
getCreateId
()
{
return
createId
;
}
public
void
setCreateId
(
Integer
createId
)
{
this
.
createId
=
createId
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Integer
getModifyId
()
{
return
modifyId
;
}
public
void
setModifyId
(
Integer
modifyId
)
{
this
.
modifyId
=
modifyId
;
}
public
Date
getModifyTime
()
{
return
modifyTime
;
}
public
void
setModifyTime
(
Date
modifyTime
)
{
this
.
modifyTime
=
modifyTime
;
}
public
int
getDeleteFlag
()
{
return
deleteFlag
;
}
public
void
setDeleteFlag
(
int
deleteFlag
)
{
this
.
deleteFlag
=
deleteFlag
;
}
}
server/src/main/java/com/pica/cloud/account/account/server/service/AccountUnionService.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
service
;
import
com.pica.cloud.account.account.server.entity.AccountUnionEntity
;
public
interface
AccountUnionService
{
/**
* 通过unionId查询绑定信息
*
* @param unionId 联合id
* @return
*/
AccountUnionEntity
selectInfoByUnionId
(
String
unionId
);
}
server/src/main/java/com/pica/cloud/account/account/server/service/DoctorService.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
service
;
import
com.pica.cloud.account.account.server.entity.Doctor
;
/**
* Created on 2019/9/11 11:01
* author:crs
* Description:医生信息接口
*/
public
interface
DoctorService
{
/**
* 获取用户信息
*
* @param id 用户id
* @return
*/
Doctor
getDoctorInfo
(
Integer
id
);
/**
* 修改医生信息
*
* @param doctor 待修改数据
*/
void
modifyDoctorInfo
(
Doctor
doctor
);
/**
* 客服系统新增医生用户
*
* @param doctor 新的医生数据
*/
Integer
addDoctorInfo
(
Doctor
doctor
);
/**
* doctor绑定微信
* @param acctId
* @param unionId
*/
void
bindWeChat
(
int
acctId
,
String
unionId
);
/**
* doctor解绑微信
* @param acctId
*/
void
unbindWeChat
(
int
acctId
);
}
server/src/main/java/com/pica/cloud/account/account/server/service/LoginService.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
service
;
import
com.pica.cloud.account.account.server.entity.LoginResult
;
import
com.pica.cloud.account.account.server.entity.PICAPDoctor
;
import
com.pica.cloud.account.account.server.req.BaseRequest
;
public
interface
LoginService
{
/**
* 密码登录功能
*
* @param request 参数模型
* @return
*/
LoginResult
login
(
BaseRequest
request
);
/**
* 一键登录功能
*
* @param request 参数模型
* @return
*/
LoginResult
loginAndRegister
(
BaseRequest
request
);
/**
* 微信登录
*
* @param baseRequest 参数模型
*/
LoginResult
loginByWeChat
(
BaseRequest
baseRequest
);
/**
* 微信登陆第二步
*
* @param request 参数模型
* @return
*/
LoginResult
loginByWeChatStep
(
BaseRequest
request
);
/**
* 解除绑定
*
* @param acctId 账户id
*/
void
unbindWeChat
(
Integer
acctId
);
/**
* 绑定微信接口
*
* @param request 参数模型
*/
void
bindWeChat
(
BaseRequest
request
);
PICAPDoctor
queryDoctor
(
long
doctorId
);
}
server/src/main/java/com/pica/cloud/account/account/server/service/ModifyMobileService.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
service
;
public
interface
ModifyMobileService
{
/**
* 修改手机号
*
* @param acctId 账户id
* @param mobile 手机号
*/
void
modify
(
Integer
acctId
,
String
mobile
);
}
server/src/main/java/com/pica/cloud/account/account/server/service/PasswordService.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
service
;
import
com.pica.cloud.account.account.server.req.BaseRequest
;
public
interface
PasswordService
{
/**
* 修改密码
*
* @param acctId 账户id
* @param oldPwd 旧密码
* @param pwd 新密码
*/
void
modifyPassword
(
Integer
acctId
,
String
oldPwd
,
String
pwd
);
/**
* 忘记密码
*
* @param request 参数模型
*/
void
forgetPassword
(
BaseRequest
request
);
}
server/src/main/java/com/pica/cloud/account/account/server/service/PatientInfoService.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
service
;
import
com.pica.cloud.account.account.server.entity.AccountPatientInfoEntity
;
public
interface
PatientInfoService
{
/**
* 更新用户信息接口
*
* @param accountPatientInfoEntity 更新信息
*/
void
updateUserInfo
(
AccountPatientInfoEntity
accountPatientInfoEntity
);
/**
* 获取用户信息接口
*
* @param userId 用户id
* @return
*/
AccountPatientInfoEntity
getUserInfo
(
Integer
userId
);
/**
* 获取用户信息接口
*
* @param acctId 账户id
* @return
*/
AccountPatientInfoEntity
getUserInfoByAcctId
(
Integer
acctId
);
/**
* 添加居民用户
*
* @param entity 居民信息
*/
void
addPatientInfo
(
AccountPatientInfoEntity
entity
,
Integer
userId
);
}
server/src/main/java/com/pica/cloud/account/account/server/service/RegisterService.java
0 → 100644
浏览文件 @
753091e7
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.BaseRequest
;
import
com.pica.cloud.account.account.common.req.OCINRequest
;
import
com.pica.cloud.foundation.entity.PicaResponse
;
public
interface
RegisterService
{
/**
* 注册
*
* @param baseRequest 参数模型
* @return token和userId
*/
LoginResult
register
(
BaseRequest
baseRequest
);
/**
* 长海项目医生注册
*
* @param request
*/
void
ocinRegister
(
OCINRequest
request
);
}
server/src/main/java/com/pica/cloud/account/account/server/service/TokenService.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
service
;
import
java.util.Map
;
/**
* Created on 2019/9/11 11:52
* author:crs
* Description:获取随机token
*/
public
interface
TokenService
{
String
getToken
(
Map
<
String
,
Object
>
map
);
}
server/src/main/java/com/pica/cloud/account/account/server/service/impl/AccountServiceImpl.java
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
service
.
impl
;
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
service
.
impl
;
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.AccountInfoEntity
;
import
com.pica.cloud.account.account.server.mapper.AccountInfoDetailMapper
;
import
com.pica.cloud.account.account.server.mapper.AccountMapper
;
import
com.pica.cloud.account.account.server.mapper.AccountMapper
;
import
com.pica.cloud.account.account.server.service.AccountService
;
import
com.pica.cloud.account.account.server.service.AccountService
;
import
com.pica.cloud.foundation.encryption.common.constants.EncryptConstants
;
import
com.pica.cloud.foundation.encryption.common.constants.EncryptConstants
;
...
@@ -12,8 +14,10 @@ import org.slf4j.Logger;
...
@@ -12,8 +14,10 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
...
@@ -32,9 +36,14 @@ public class AccountServiceImpl implements AccountService {
...
@@ -32,9 +36,14 @@ public class AccountServiceImpl implements AccountService {
@Autowired
@Autowired
private
AccountMapper
accountMapper
;
private
AccountMapper
accountMapper
;
@Autowired
@Autowired
private
AccountInfoDetailMapper
accountInfoDetailMapper
;
@Autowired
@Qualifier
(
"cacheMigrateClient"
)
@Qualifier
(
"cacheMigrateClient"
)
private
ICacheClient
cacheClient
;
private
ICacheClient
cacheClient
;
@Value
(
"${doubleWritingMode}"
)
private
boolean
doubleWritingMode
;
//根据ID获取账号
//根据ID获取账号
@Override
@Override
public
Account
getById
(
long
id
)
{
public
Account
getById
(
long
id
)
{
...
@@ -57,17 +66,36 @@ public class AccountServiceImpl implements AccountService {
...
@@ -57,17 +66,36 @@ public class AccountServiceImpl implements AccountService {
@Override
@Override
@Transactional
@Transactional
public
void
createAccount
(
Account
account
)
{
public
void
createAccount
(
Account
account
)
{
//账户表
AccountInfoEntity
accountInfo
=
new
AccountInfoEntity
();
Date
currentTime
=
new
Date
();
Date
currentTime
=
new
Date
();
account
.
setMobilePhone
(
EncryptUtils
.
encryptContent
(
account
.
getMobilePhone
(),
EncryptConstants
.
ENCRYPT_TYPE_MOBILE
));
//手机号加密
accountInfo
.
setMobilePhone
(
account
.
getMobilePhone
());
accountInfo
.
setPassword
(
""
);
accountInfo
.
setCreatedTime
(
currentTime
);
accountInfo
.
setCreatedId
(
0
);
accountInfo
.
setModifiedId
(
0
);
accountInfo
.
setModifiedTime
(
currentTime
);
accountInfo
.
setRegTime
(
currentTime
);
accountInfo
.
setDeleteFlag
(
1
);
accountInfo
.
setSex
(
0
);
accountInfo
.
setRegisterProduct
(
1
);
accountInfo
.
setRegisterSource
(
5
);
accountInfoDetailMapper
.
insertSelective
(
accountInfo
);
Integer
acctId
=
accountInfo
.
getId
();
//doctor表,存入用户id
if
(
doubleWritingMode
)
{
account
.
setMobilePhone
(
account
.
getMobilePhone
());
account
.
setDeleteFlag
(
1
);
account
.
setDeleteFlag
(
1
);
account
.
setCreatId
(
0L
);
account
.
setCreatId
(
0L
);
account
.
setModifyId
(
0L
);
account
.
setModifyId
(
0L
);
account
.
setAcctId
(
acctId
);
account
.
setCreatTime
(
currentTime
);
account
.
setCreatTime
(
currentTime
);
account
.
setModifyTime
(
currentTime
);
account
.
setModifyTime
(
currentTime
);
account
.
setFirstLoginTime
(
currentTime
);
account
.
setFirstLoginTime
(
currentTime
);
account
.
setLastLoginTime
(
currentTime
);
account
.
setLastLoginTime
(
currentTime
);
accountMapper
.
insertSelective
(
account
);
accountMapper
.
insertSelective
(
account
);
}
}
}
//更新账号信息
//更新账号信息
@Override
@Override
...
...
server/src/main/java/com/pica/cloud/account/account/server/service/impl/AccountUnionServiceImpl.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
service
.
impl
;
import
com.pica.cloud.account.account.server.entity.AccountUnionEntity
;
import
com.pica.cloud.account.account.server.mapper.AccountUnionMapper
;
import
com.pica.cloud.account.account.server.service.AccountUnionService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
@Service
public
class
AccountUnionServiceImpl
implements
AccountUnionService
{
@Autowired
private
AccountUnionMapper
accountUnionMapper
;
@Override
public
AccountUnionEntity
selectInfoByUnionId
(
String
unionId
)
{
return
accountUnionMapper
.
selectByUnionId
(
unionId
);
}
}
server/src/main/java/com/pica/cloud/account/account/server/service/impl/DoctorServiceImpl.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
service
.
impl
;
import
com.pica.cloud.account.account.server.entity.AccountInfoEntity
;
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.mapper.AccountInfoDetailMapper
;
import
com.pica.cloud.account.account.server.mapper.DoctorMapper
;
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
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
java.util.Date
;
/**
* Created on 2019/9/11 11:02
* author:crs
* Description:医生相关Service
*/
@Service
public
class
DoctorServiceImpl
implements
DoctorService
{
@Autowired
private
DoctorMapper
doctorMapper
;
@Autowired
private
AccountInfoDetailMapper
accountInfoDetailMapper
;
@Override
public
Doctor
getDoctorInfo
(
Integer
id
)
{
return
doctorMapper
.
selectByPrimaryKey
(
id
);
}
@Override
public
void
modifyDoctorInfo
(
Doctor
doctor
)
{
Integer
id
=
doctor
.
getId
();
if
(
id
==
null
){
throw
new
AccountException
(
AccountExceptionEnum
.
PICA_PARAMS_ERROR
);
}
Doctor
entity
=
doctorMapper
.
selectByPrimaryKey
(
id
);
if
(
entity
==
null
){
throw
new
AccountException
(
AccountExceptionEnum
.
PICA_NOT_EXIST
);
}
String
mobilePhone
=
doctor
.
getMobilePhone
();
if
(!
StringUtils
.
isBlank
(
mobilePhone
)){
AccountUtils
.
checkMobilePhone
(
doctor
.
getMobilePhone
());
}
doctor
.
setMobilePhone
(
AESUtil
.
encryptV0
(
mobilePhone
));
doctor
.
setModifyTime
(
new
Date
());
doctorMapper
.
updateByPrimaryKeySelective
(
doctor
);
}
/**
* 客服管理后台添加医生
* 1)当前医生信息是否存在,如果已经存在直接抛出异常;
* 2)账户表和医生表;
* 3)手机号进行加密存储;
* 4)账户基本信息的处理:姓名,性别,年龄,生日,身份证号;
*
* @param doctor 新的医生数据
*/
@Override
@Transactional
public
Integer
addDoctorInfo
(
Doctor
doctor
)
{
String
mobilePhone
=
doctor
.
getMobilePhone
();
String
mobileEncrypt
=
AESUtil
.
encryptV0
(
mobilePhone
);
AccountInfoEntity
accountInfoEntity
=
accountInfoDetailMapper
.
selectByMobile
(
mobileEncrypt
);
if
(
accountInfoEntity
!=
null
)
{
throw
new
AccountException
(
AccountExceptionEnum
.
PICA_ALREADY_REGISTER
);
}
String
password
=
doctor
.
getPassword
();
Date
currentTime
=
new
Date
();
AccountInfoEntity
entity
=
new
AccountInfoEntity
();
entity
.
setMobilePhone
(
mobileEncrypt
);
entity
.
setPassword
(
password
);
entity
.
setCreatedTime
(
currentTime
);
entity
.
setModifiedTime
(
currentTime
);
entity
.
setModifiedId
(
0
);
entity
.
setRegisterProduct
(
1
);
entity
.
setRegTime
(
currentTime
);
entity
.
setRegisterSource
(
3
);
entity
.
setCreatedId
(
0
);
entity
.
setDeleteFlag
(
1
);
entity
.
setSex
(
doctor
.
getSex
());
entity
.
setName
(
doctor
.
getName
());
entity
.
setIdCard
(
doctor
.
getCard
());
entity
.
setAge
(
doctor
.
getAge
());
entity
.
setBirthday
(
doctor
.
getBirthday
());
accountInfoDetailMapper
.
insertSelective
(
entity
);
doctor
.
setAcctId
(
entity
.
getId
());
doctor
.
setMobilePhone
(
mobileEncrypt
);
doctor
.
setModifyId
(
0
);
doctor
.
setCreatId
(
0
);
doctor
.
setCreatTime
(
currentTime
);
doctor
.
setModifyTime
(
new
Date
());
doctor
.
setDeleteFlag
(
1
);
doctorMapper
.
insertSelective
(
doctor
);
return
doctor
.
getId
();
}
@Override
@Transactional
public
void
bindWeChat
(
int
acctId
,
String
unionId
)
{
doctorMapper
.
bindWeChat
(
acctId
,
unionId
);
}
@Override
@Transactional
public
void
unbindWeChat
(
int
acctId
)
{
doctorMapper
.
unbindWeChat
(
acctId
);
}
}
server/src/main/java/com/pica/cloud/account/account/server/service/impl/LoginServiceImpl.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
service
.
impl
;
import
com.pica.cloud.account.account.server.entity.*
;
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.log.AccountLogEntityUtils
;
import
com.pica.cloud.account.account.server.log.AccountLogUtils
;
import
com.pica.cloud.account.account.server.mapper.*
;
import
com.pica.cloud.account.account.server.req.BaseRequest
;
import
com.pica.cloud.account.account.server.service.DoctorService
;
import
com.pica.cloud.account.account.server.service.LoginService
;
import
com.pica.cloud.account.account.server.service.RegisterService
;
import
com.pica.cloud.account.account.server.util.AESUtil
;
import
com.pica.cloud.account.account.server.util.AccountUtils
;
import
com.pica.cloud.account.account.server.util.TokenUtils
;
import
com.pica.cloud.account.account.server.util.WeChatUtils
;
import
com.pica.cloud.foundation.entity.PicaException
;
import
com.pica.cloud.foundation.redis.ICacheClient
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
@Service
public
class
LoginServiceImpl
implements
LoginService
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
@Autowired
private
AccountInfoDetailMapper
accountInfoDetailMapper
;
@Autowired
private
AccountUnionMapper
accountUnionMapper
;
@Autowired
private
AccountWeChatInfoMapper
accountWeChatInfoMapper
;
@Autowired
private
AccountPatientInfoMapper
accountPatientInfoMapper
;
@Autowired
private
AccountLogUtils
picaLogUtils
;
@Autowired
private
TokenUtils
tokenUtils
;
@Autowired
private
RegisterService
registerService
;
@Autowired
private
DoctorMapper
doctorInfoMapper
;
@Autowired
private
AccountUtils
accountUtils
;
@Autowired
private
DoctorService
doctorService
;
@Autowired
@Qualifier
(
"cacheMigrateClient"
)
private
ICacheClient
redisClient
;
@Value
(
"${doubleWritingMode}"
)
private
boolean
doubleWritingMode
;
@Value
(
"${weChatAppID}"
)
private
String
appId
;
@Value
(
"${weChatAppSecret}"
)
private
String
appSecret
;
@Value
(
"${weChatURL}"
)
private
String
weChatURL
;
private
static
final
String
DEFAULT_DOCTOR_PICTURE_URL
=
"/File/doctor_default.png"
;
public
static
Map
<
String
,
String
>
PIC_TYPE_MAP
=
new
HashMap
();
static
{
PIC_TYPE_MAP
.
put
(
"jpg"
,
"FFD8FF"
);
PIC_TYPE_MAP
.
put
(
"jpeg"
,
"FFD8FF"
);
PIC_TYPE_MAP
.
put
(
"png"
,
"89504E47"
);
PIC_TYPE_MAP
.
put
(
"gif"
,
"47494638"
);
PIC_TYPE_MAP
.
put
(
"bmp"
,
"424D"
);
PIC_TYPE_MAP
.
put
(
"png"
,
"89504E470D0a1a0a0000"
);
PIC_TYPE_MAP
.
put
(
"bmp"
,
"424d228c010000000000"
);
PIC_TYPE_MAP
.
put
(
"bmp"
,
"424d8240090000000000"
);
PIC_TYPE_MAP
.
put
(
"bmp"
,
"424d8e1b030000000000"
);
}
@Override
public
LoginResult
login
(
BaseRequest
request
)
{
String
mobile
=
request
.
getMobile
();
String
encrypt
=
AESUtil
.
encryptV0
(
mobile
);
AccountInfoEntity
accountInfoEntity
=
accountInfoDetailMapper
.
selectByMobile
(
encrypt
);
if
(
accountInfoEntity
!=
null
)
{
String
oldPwd
=
accountInfoEntity
.
getPassword
();
String
password
=
request
.
getPassword
();
if
(
password
.
equals
(
oldPwd
))
{
Date
currentTime
=
new
Date
();
Integer
acctId
=
accountInfoEntity
.
getId
();
int
productType
=
request
.
getProductType
();
int
sourceType
=
request
.
getSourceType
();
Doctor
doctorInfo
=
doctorInfoMapper
.
getDoctorInfoByMobile
(
encrypt
);
Integer
userId
=
0
;
if
(
productType
==
AccountTypeEnum
.
PRODUCT_TYPE_DOCTOR
.
getCode
())
{
userId
=
doctorInfo
.
getId
();
}
else
if
(
productType
==
AccountTypeEnum
.
PRODUCT_TYPE_HEALTH
.
getCode
())
{
AccountPatientInfoEntity
accountPatientInfoEntity
=
accountPatientInfoMapper
.
selectByAcctId
(
acctId
);
userId
=
accountPatientInfoEntity
.
getId
();
}
Account
account
=
new
Account
();
account
.
setId
(
userId
.
longValue
());
account
.
setAcctId
(
acctId
);
account
.
setCreatTime
(
currentTime
);
account
.
setMobilePhone
(
mobile
);
account
.
setRegisterSource
(
sourceType
);
String
newToken
=
tokenUtils
.
generateToken
(
account
);
LoginResult
result
=
new
LoginResult
();
result
.
setToken
(
newToken
);
result
.
setUserId
(
userId
.
longValue
());
if
(
productType
==
AccountTypeEnum
.
PRODUCT_TYPE_DOCTOR
.
getCode
())
{
result
.
setEntireFlag
(
doctorInfo
.
getEntireFlag
());
}
LogLoginEntity
entity
=
AccountLogEntityUtils
.
getLogLoginEntity
(
acctId
,
productType
,
sourceType
,
AccountTypeEnum
.
LOGIN_PWD
.
getCode
(),
request
.
getLoginIp
(),
AccountTypeEnum
.
LOGIN_STATUS_SUCCESS
.
getCode
(),
AccountTypeEnum
.
LOG_TYPE_LOGIN
.
getCode
());
picaLogUtils
.
info
(
entity
);
return
result
;
}
else
{
logger
.
info
(
"login failure:"
+
mobile
);
throw
new
PicaException
(
AccountExceptionEnum
.
PICA_PASSWORD_ERROR
.
getCode
(),
AccountExceptionEnum
.
PICA_PASSWORD_ERROR
.
getMessage
());
}
}
else
{
throw
new
PicaException
(
AccountExceptionEnum
.
PICA_NOT_REGISTER
.
getCode
(),
AccountExceptionEnum
.
PICA_NOT_REGISTER
.
getMessage
());
}
}
@Override
public
LoginResult
loginAndRegister
(
BaseRequest
baseRequest
)
{
String
mobile
=
baseRequest
.
getMobile
();
AccountInfoEntity
accountInfoEntity
=
accountInfoDetailMapper
.
selectByMobile
(
AESUtil
.
encryptV0
(
mobile
));
if
(
accountInfoEntity
==
null
)
{
return
registerService
.
register
(
baseRequest
);
}
else
{
return
processLogin
(
baseRequest
,
accountInfoEntity
.
getId
(),
AccountTypeEnum
.
LOGIN_CODE
.
getCode
());
}
}
/**
* 登录逻辑处理
*
* @param baseRequest
*/
private
LoginResult
processLogin
(
BaseRequest
baseRequest
,
Integer
acctId
,
Integer
loginType
)
{
Date
currentTime
=
new
Date
();
Long
userId
=
accountUtils
.
getUserIdByAcctId
(
baseRequest
.
getProductType
(),
acctId
);
Account
account
=
new
Account
();
account
.
setId
(
userId
);
account
.
setAcctId
(
acctId
);
account
.
setCreatTime
(
currentTime
);
account
.
setMobilePhone
(
baseRequest
.
getMobile
());
account
.
setRegisterSource
(
baseRequest
.
getSourceType
());
String
newToken
=
tokenUtils
.
generateToken
(
account
);
LoginResult
result
=
new
LoginResult
();
result
.
setToken
(
newToken
);
result
.
setUserId
(
userId
);
//是否完善过个人信息(云鹊医app才需要)
if
(
baseRequest
.
getProductType
()
==
AccountTypeEnum
.
PRODUCT_TYPE_DOCTOR
.
getCode
())
{
Doctor
doctorEntity
=
doctorInfoMapper
.
selectByPrimaryKey
(
userId
.
intValue
());
result
.
setEntireFlag
(
doctorEntity
.
getEntireFlag
());
}
//记录登录日志
LogLoginEntity
entity
=
AccountLogEntityUtils
.
getLogLoginEntity
(
acctId
,
baseRequest
.
getProductType
(),
baseRequest
.
getSourceType
(),
loginType
,
baseRequest
.
getLoginIp
(),
AccountTypeEnum
.
LOGIN_STATUS_SUCCESS
.
getCode
(),
AccountTypeEnum
.
LOG_TYPE_LOGIN
.
getCode
());
;
picaLogUtils
.
info
(
entity
);
return
result
;
}
@Override
public
LoginResult
loginByWeChat
(
BaseRequest
request
)
{
WeChatEntity
weChatEntity
=
WeChatUtils
.
getAuthorizationInfo
(
appId
,
appSecret
,
request
.
getWeChatCode
());
//todo:微信登录获取个人信息
Map
map
=
new
HashMap
();
map
.
put
(
"access_token"
,
weChatEntity
.
getAccess_token
());
map
.
put
(
"openid"
,
weChatEntity
.
getOpenid
());
Map
weChatUserInfo
=
WeChatUtils
.
getWeChatUserInfo
(
map
,
weChatURL
);
WeChatUserInfoEntity
weChatUserInfoEntity
=
WeChatUtils
.
mergeWechatUserInfo
(
weChatUserInfo
,
weChatEntity
.
getOpenid
());
String
unionId
=
weChatUserInfoEntity
.
getUnionid
();
AccountUnionEntity
accountUnionEntity
=
accountUnionMapper
.
selectByUnionId
(
unionId
);
if
(
accountUnionEntity
!=
null
)
{
//是否绑定逻辑的判断
Long
acctId
=
accountUnionEntity
.
getAcctId
();
Long
userId
=
accountUtils
.
getUserIdByAcctId
(
request
.
getProductType
(),
acctId
.
intValue
());
Account
account
=
new
Account
();
account
.
setId
(
userId
);
account
.
setAcctId
(
acctId
.
intValue
());
account
.
setCreatTime
(
new
Date
());
//account.setMobilePhone(request.getMobile());
account
.
setMobilePhone
(
""
);
account
.
setRegisterSource
(
request
.
getSourceType
());
String
newToken
=
tokenUtils
.
generateToken
(
account
);
LoginResult
result
=
new
LoginResult
();
result
.
setToken
(
newToken
);
result
.
setUserId
(
userId
);
result
.
setBindFlag
(
AccountTypeEnum
.
BIND_STATUS_SUCCESS
.
getCode
()+
""
);
return
result
;
}
else
{
AccountWeChatInfoEntity
entity
=
accountWeChatInfoMapper
.
selectByUnionId
(
unionId
);
if
(
entity
==
null
)
{
processWeChatInfoUser
(
weChatUserInfoEntity
,
request
.
getWeChatLoginType
());
}
LoginResult
result
=
new
LoginResult
();
result
.
setUnionId
(
unionId
);
result
.
setBindFlag
(
AccountTypeEnum
.
BIND_STATUS_FAILURE
.
getCode
()+
""
);
return
result
;
}
}
@Override
public
LoginResult
loginByWeChatStep
(
BaseRequest
request
)
{
//判断当前手机号是否注册过,注册过,直接登录;没有注册过,进行注册操操作
AccountInfoEntity
accountInfoEntity
=
accountInfoDetailMapper
.
selectByMobile
(
AESUtil
.
encryptV0
(
request
.
getMobile
()));
LoginResult
result
;
if
(
accountInfoEntity
==
null
)
{
result
=
registerService
.
register
(
request
);
if
(
doubleWritingMode
)
{
//双写模式下,要在doctor表存储unionId
if
(
result
.
getUserId
()!=
null
)
{
Doctor
doctor
=
new
Doctor
();
doctor
.
setId
(
result
.
getUserId
().
intValue
());
doctor
.
setUnionid
(
request
.
getUnionId
());
doctorInfoMapper
.
updateByPrimaryKeySelective
(
doctor
);
}
}
}
else
{
result
=
processLogin
(
request
,
accountInfoEntity
.
getId
(),
AccountTypeEnum
.
LOGIN_WE_CHAT
.
getCode
());
}
AccountInfoEntity
accountInfo
=
accountInfoDetailMapper
.
selectByMobile
(
AESUtil
.
encryptV0
(
request
.
getMobile
()));
Integer
acctId
=
accountInfo
.
getId
();
processAccountUnion
(
acctId
,
request
.
getUnionId
());
return
result
;
}
@Override
@Transactional
public
void
unbindWeChat
(
Integer
acctId
)
{
accountUnionMapper
.
updateUnbindByAcctId
(
acctId
);
if
(
doubleWritingMode
)
{
doctorService
.
unbindWeChat
(
acctId
);
}
}
@Override
@Transactional
public
void
bindWeChat
(
BaseRequest
request
)
{
WeChatEntity
weChatEntity
=
WeChatUtils
.
getAuthorizationInfo
(
appId
,
appSecret
,
request
.
getWeChatCode
());
Map
map
=
new
HashMap
();
map
.
put
(
"access_token"
,
weChatEntity
.
getAccess_token
());
map
.
put
(
"openid"
,
weChatEntity
.
getOpenid
());
Map
weChatUserInfo
=
WeChatUtils
.
getWeChatUserInfo
(
map
,
weChatURL
);
WeChatUserInfoEntity
weChatUserInfoEntity
=
WeChatUtils
.
mergeWechatUserInfo
(
weChatUserInfo
,
weChatEntity
.
getOpenid
());
String
unionId
=
weChatUserInfoEntity
.
getUnionid
();
AccountWeChatInfoEntity
entity
=
accountWeChatInfoMapper
.
selectByUnionId
(
unionId
);
if
(
entity
==
null
)
{
processWeChatInfoUser
(
weChatUserInfoEntity
,
request
.
getWeChatLoginType
());
}
processAccountUnion
(
request
.
getAccId
(),
unionId
);
}
/**
* 把unionId存储到联合登录表中
*
* @param acctId
* @param unionId
*/
private
void
processAccountUnion
(
Integer
acctId
,
String
unionId
)
{
AccountUnionEntity
accountUnionEntity
=
new
AccountUnionEntity
();
accountUnionEntity
.
setAcctId
(
acctId
.
longValue
());
accountUnionEntity
.
setDeleteFlag
(
1
);
accountUnionEntity
.
setUnionId
(
unionId
);
accountUnionEntity
.
setCreatedTime
(
new
Date
());
accountUnionEntity
.
setModifiedTime
(
new
Date
());
accountUnionEntity
.
setCreatedId
(
acctId
);
accountUnionEntity
.
setModifiedId
(
acctId
);
accountUnionEntity
.
setUnionType
(
AccountTypeEnum
.
UNION_LOGIN_WE_CHAT
.
getCode
());
accountUnionMapper
.
insertSelective
(
accountUnionEntity
);
if
(
doubleWritingMode
)
{
//双写模式
doctorService
.
bindWeChat
(
acctId
,
unionId
);
}
}
private
void
processWeChatInfoUser
(
WeChatUserInfoEntity
weChatUserInfoEntity
,
int
type
)
{
AccountWeChatInfoEntity
accountWeChatInfoEntity
=
new
AccountWeChatInfoEntity
();
Date
currentTime
=
new
Date
();
accountWeChatInfoEntity
.
setCreatedId
(
0
);
accountWeChatInfoEntity
.
setCreatedTime
(
currentTime
);
accountWeChatInfoEntity
.
setDeleteFlag
(
1
);
accountWeChatInfoEntity
.
setGroupid
(
weChatUserInfoEntity
.
getGroupid
()
+
""
);
accountWeChatInfoEntity
.
setType
(
type
);
accountWeChatInfoEntity
.
setModifiedId
(
0
);
accountWeChatInfoEntity
.
setModifiedTime
(
currentTime
);
accountWeChatInfoEntity
.
setOpenid
(
weChatUserInfoEntity
.
getOpenid
());
accountWeChatInfoEntity
.
setUnionid
(
weChatUserInfoEntity
.
getUnionid
());
accountWeChatInfoEntity
.
setPrivilege
(
weChatUserInfoEntity
.
getPrivilege
());
accountWeChatInfoEntity
.
setRemark
(
weChatUserInfoEntity
.
getRemark
());
accountWeChatInfoEntity
.
setSubscribe
(
weChatUserInfoEntity
.
getSubscribe
());
accountWeChatInfoEntity
.
setSubscribeTime
(
weChatUserInfoEntity
.
getSubscribe_time
());
accountWeChatInfoEntity
.
setTagidList
(
weChatUserInfoEntity
.
getTagid_list
());
accountWeChatInfoEntity
.
setCity
(
weChatUserInfoEntity
.
getCity
());
accountWeChatInfoEntity
.
setNickname
(
weChatUserInfoEntity
.
getNickname
());
accountWeChatInfoEntity
.
setHeadImgUrl
(
weChatUserInfoEntity
.
getHeadimgurl
());
accountWeChatInfoEntity
.
setCountry
(
weChatUserInfoEntity
.
getCountry
());
accountWeChatInfoEntity
.
setSex
(
weChatUserInfoEntity
.
getSex
());
accountWeChatInfoEntity
.
setProvince
(
weChatUserInfoEntity
.
getProvince
());
accountWeChatInfoEntity
.
setLanguage
(
weChatUserInfoEntity
.
getLanguage
());
accountWeChatInfoMapper
.
insertSelective
(
accountWeChatInfoEntity
);
}
public
PICAPDoctor
queryDoctor
(
long
doctorId
)
{
PICAPDoctor
doctor
=
doctorInfoMapper
.
queryDoctor
(
doctorId
);
if
(
doctor
==
null
)
{
doctor
=
new
PICAPDoctor
();
}
doctor
.
setAvatar_image_url
(
this
.
processDoctorAvatar
(
doctor
.
getAvatar_image_url
()));
return
doctor
;
}
private
String
processDoctorAvatar
(
String
avatar_image_url
)
{
if
(
StringUtils
.
isEmpty
(
avatar_image_url
))
{
return
DEFAULT_DOCTOR_PICTURE_URL
;
}
else
{
int
pos
=
avatar_image_url
.
lastIndexOf
(
"."
);
if
(
pos
<
0
)
{
return
DEFAULT_DOCTOR_PICTURE_URL
;
}
else
{
String
ext
=
avatar_image_url
.
substring
(
pos
+
1
,
avatar_image_url
.
length
()).
toLowerCase
();
return
!
PIC_TYPE_MAP
.
containsKey
(
ext
)
?
DEFAULT_DOCTOR_PICTURE_URL
:
avatar_image_url
;
}
}
}
}
server/src/main/java/com/pica/cloud/account/account/server/service/impl/ModifyMobileServiceImpl.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
service
.
impl
;
import
com.pica.cloud.account.account.server.entity.AccountInfoEntity
;
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.mapper.AccountInfoDetailMapper
;
import
com.pica.cloud.account.account.server.mapper.DoctorMapper
;
import
com.pica.cloud.account.account.server.service.ModifyMobileService
;
import
com.pica.cloud.account.account.server.util.AESUtil
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Date
;
@Service
public
class
ModifyMobileServiceImpl
implements
ModifyMobileService
{
@Autowired
private
AccountInfoDetailMapper
accountInfoDetailMapper
;
@Autowired
private
DoctorMapper
doctorMapper
;
@Value
(
"${doubleWritingMode}"
)
private
boolean
doubleWritingMode
;
@Override
@Transactional
public
void
modify
(
Integer
acctId
,
String
mobile
)
{
AccountInfoEntity
entity
=
accountInfoDetailMapper
.
selectByPrimaryKey
(
acctId
);
String
mobilePhone
=
entity
.
getMobilePhone
();
if
(
StringUtils
.
isNotEmpty
(
mobilePhone
)
&&
AESUtil
.
decryptV0
(
mobilePhone
).
equals
(
mobile
))
{
throw
new
AccountException
(
AccountExceptionEnum
.
PICA_MOBILE_SAME
);
}
AccountInfoEntity
accountInfoEntity
=
new
AccountInfoEntity
();
accountInfoEntity
.
setId
(
acctId
);
accountInfoEntity
.
setModifiedId
(
acctId
);
accountInfoEntity
.
setModifiedTime
(
new
Date
());
accountInfoEntity
.
setMobilePhone
(
AESUtil
.
encryptV0
(
mobile
));
accountInfoDetailMapper
.
updateMobileByPrimaryKey
(
accountInfoEntity
);
if
(
doubleWritingMode
)
{
//更新p_doctor表中用户的手机号
Date
currentTime
=
new
Date
();
Doctor
doctor
=
new
Doctor
();
doctor
.
setAcctId
(
acctId
);
doctor
.
setModifyTime
(
currentTime
);
doctor
.
setModifyId
(
acctId
);
doctor
.
setMobilePhone
(
AESUtil
.
encryptV0
(
mobile
));
doctorMapper
.
updateByAcctId
(
doctor
);
}
}
}
server/src/main/java/com/pica/cloud/account/account/server/service/impl/PasswordServiceImpl.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
service
.
impl
;
import
com.pica.cloud.account.account.server.entity.AccountInfoEntity
;
import
com.pica.cloud.account.account.server.entity.Doctor
;
import
com.pica.cloud.account.account.server.entity.LogPWDModifyEntity
;
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.log.AccountLogEntityUtils
;
import
com.pica.cloud.account.account.server.log.AccountLogUtils
;
import
com.pica.cloud.account.account.server.mapper.AccountInfoDetailMapper
;
import
com.pica.cloud.account.account.server.mapper.DoctorMapper
;
import
com.pica.cloud.account.account.server.req.BaseRequest
;
import
com.pica.cloud.account.account.server.service.PasswordService
;
import
com.pica.cloud.account.account.server.util.AESUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Date
;
@Service
public
class
PasswordServiceImpl
implements
PasswordService
{
@Autowired
private
AccountInfoDetailMapper
accountInfoDetailMapper
;
@Autowired
private
DoctorMapper
doctorMapper
;
@Autowired
private
AccountLogUtils
picaLogUtils
;
@Value
(
"${doubleWritingMode}"
)
private
boolean
doubleWritingMode
;
@Override
@Transactional
public
void
modifyPassword
(
Integer
acctId
,
String
oldPwd
,
String
pwd
)
{
AccountInfoEntity
entity
=
accountInfoDetailMapper
.
selectByPrimaryKey
(
acctId
);
if
(
entity
.
getPassword
().
equals
(
oldPwd
))
{
Date
currentTime
=
new
Date
();
AccountInfoEntity
accountInfoEntity
=
new
AccountInfoEntity
();
accountInfoEntity
.
setId
(
acctId
);
accountInfoEntity
.
setModifiedId
(
acctId
);
accountInfoEntity
.
setModifiedTime
(
currentTime
);
accountInfoEntity
.
setPassword
(
pwd
);
accountInfoDetailMapper
.
updatePasswordByPrimaryKey
(
accountInfoEntity
);
if
(
doubleWritingMode
)
{
processDoubleWrite
(
acctId
,
pwd
);
}
//密码修改日志
LogPWDModifyEntity
logPWDModifyEntity
=
AccountLogEntityUtils
.
getLogPWDModifyEntity
(
acctId
,
entity
.
getMobilePhone
(),
oldPwd
,
pwd
,
AccountTypeEnum
.
LOG_TYPE_PASSWORD
.
getCode
());
picaLogUtils
.
info
(
logPWDModifyEntity
);
}
else
{
throw
new
AccountException
(
AccountExceptionEnum
.
PICA_PASSWORD_ERROR
);
}
}
@Override
@Transactional
public
void
forgetPassword
(
BaseRequest
request
)
{
AccountInfoEntity
entity
=
accountInfoDetailMapper
.
selectByMobile
(
AESUtil
.
encryptV0
(
request
.
getMobile
()));
if
(
entity
!=
null
)
{
String
password
=
request
.
getPassword
();
Integer
accId
=
entity
.
getId
();
Date
currentTime
=
new
Date
();
AccountInfoEntity
accountInfoEntity
=
new
AccountInfoEntity
();
accountInfoEntity
.
setId
(
accId
);
accountInfoEntity
.
setModifiedId
(
accId
);
accountInfoEntity
.
setModifiedTime
(
currentTime
);
accountInfoEntity
.
setPassword
(
password
);
accountInfoDetailMapper
.
updatePasswordByPrimaryKey
(
accountInfoEntity
);
if
(
doubleWritingMode
)
{
processDoubleWrite
(
accId
,
password
);
}
//密码修改日志
LogPWDModifyEntity
logPWDModifyEntity
=
AccountLogEntityUtils
.
getLogPWDModifyEntity
(
accId
,
entity
.
getMobilePhone
(),
""
,
request
.
getPassword
(),
AccountTypeEnum
.
LOG_TYPE_PASSWORD
.
getCode
());
picaLogUtils
.
info
(
logPWDModifyEntity
);
}
else
{
//未注册,请先注册
throw
new
AccountException
(
AccountExceptionEnum
.
PICA_NOT_REGISTER
);
}
}
/**
* 双写模式,把密码存储到p_doctor表
*
* @param accId
* @param password
*/
private
void
processDoubleWrite
(
Integer
accId
,
String
password
)
{
Date
currentTime
=
new
Date
();
Doctor
doctor
=
new
Doctor
();
doctor
.
setPassword
(
password
);
doctor
.
setAcctId
(
accId
);
doctor
.
setModifyTime
(
currentTime
);
doctor
.
setModifyId
(
accId
);
doctorMapper
.
updateByAcctId
(
doctor
);
}
}
server/src/main/java/com/pica/cloud/account/account/server/service/impl/PatientInfoServerImpl.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
service
.
impl
;
import
com.pica.cloud.account.account.server.entity.AccountInfoEntity
;
import
com.pica.cloud.account.account.server.entity.AccountPatientInfoEntity
;
import
com.pica.cloud.account.account.server.entity.LogUserInfoEntity
;
import
com.pica.cloud.account.account.server.enums.AccountTypeEnum
;
import
com.pica.cloud.account.account.server.log.AccountLogUtils
;
import
com.pica.cloud.account.account.server.mapper.AccountInfoDetailMapper
;
import
com.pica.cloud.account.account.server.mapper.AccountPatientInfoMapper
;
import
com.pica.cloud.account.account.server.service.PatientInfoService
;
import
com.pica.cloud.account.account.server.util.AESUtil
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.lang.reflect.InvocationTargetException
;
import
java.util.Date
;
@Service
public
class
PatientInfoServerImpl
implements
PatientInfoService
{
@Autowired
private
AccountPatientInfoMapper
accountPatientInfoMapper
;
@Autowired
private
AccountLogUtils
accountLogUtils
;
@Autowired
private
AccountInfoDetailMapper
accountInfoDetailMapper
;
@Override
public
void
updateUserInfo
(
AccountPatientInfoEntity
accountPatientInfoEntity
)
{
accountPatientInfoEntity
.
setModifyTime
(
new
Date
());
accountPatientInfoEntity
.
setModifyId
(
accountPatientInfoEntity
.
getAcctId
());
accountPatientInfoMapper
.
updateByPrimaryKeySelective
(
accountPatientInfoEntity
);
//用户信息更新日志
Integer
userId
=
accountPatientInfoEntity
.
getId
();
AccountPatientInfoEntity
userInfo
=
getUserInfo
(
userId
);
LogUserInfoEntity
logUserInfoEntity
=
new
LogUserInfoEntity
();
try
{
BeanUtils
.
copyProperties
(
logUserInfoEntity
,
userInfo
);
Date
currentTime
=
new
Date
();
logUserInfoEntity
.
setCreateTime
(
currentTime
);
logUserInfoEntity
.
setModifyTime
(
currentTime
);
logUserInfoEntity
.
setLogType
(
AccountTypeEnum
.
LOG_TYPE_USER_INFO
.
getCode
());
accountLogUtils
.
info
(
logUserInfoEntity
);
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
catch
(
InvocationTargetException
e
)
{
e
.
printStackTrace
();
}
}
@Override
public
AccountPatientInfoEntity
getUserInfo
(
Integer
userId
)
{
return
accountPatientInfoMapper
.
selectByUserId
(
userId
);
}
@Override
public
AccountPatientInfoEntity
getUserInfoByAcctId
(
Integer
acctId
)
{
return
accountPatientInfoMapper
.
selectByAcctId
(
acctId
);
}
@Override
@Transactional
public
void
addPatientInfo
(
AccountPatientInfoEntity
entity
,
Integer
userId
)
{
String
mobilePhone
=
entity
.
getMobilePhone
();
Date
currentTime
=
new
Date
();
AccountInfoEntity
accountInfoEntity
=
new
AccountInfoEntity
();
accountInfoEntity
.
setMobilePhone
(
mobilePhone
);
accountInfoEntity
.
setCreatedTime
(
currentTime
);
accountInfoEntity
.
setModifiedTime
(
currentTime
);
accountInfoEntity
.
setModifiedId
(
userId
);
accountInfoEntity
.
setCreatedId
(
userId
);
accountInfoEntity
.
setDeleteFlag
(
1
);
//居民:姓名和手机号
accountInfoEntity
.
setName
(
entity
.
getName
());
accountInfoDetailMapper
.
insertSelective
(
accountInfoEntity
);
entity
.
setAcctId
(
accountInfoEntity
.
getId
());
entity
.
setMobilePhone
(
AESUtil
.
encryptV0
(
entity
.
getMobilePhone
()));
entity
.
setModifyId
(
userId
);
entity
.
setModifyTime
(
currentTime
);
accountPatientInfoMapper
.
insertSelective
(
entity
);
}
}
server/src/main/java/com/pica/cloud/account/account/server/service/impl/RegisterServiceImpl.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
service
.
impl
;
import
com.pica.cloud.account.account.common.req.OCINRequest
;
import
com.pica.cloud.account.account.server.entity.*
;
import
com.pica.cloud.account.account.server.enums.AccountAgreementEnum
;
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.log.AccountLogEntityUtils
;
import
com.pica.cloud.account.account.server.log.AccountLogUtils
;
import
com.pica.cloud.account.account.server.mapper.*
;
import
com.pica.cloud.account.account.server.queue.QueueProducer
;
import
com.pica.cloud.account.account.server.req.BaseRequest
;
import
com.pica.cloud.account.account.server.service.RegisterService
;
import
com.pica.cloud.account.account.server.util.AESUtil
;
import
com.pica.cloud.account.account.server.util.AccountUtils
;
import
com.pica.cloud.account.account.server.util.ExecutorServiceUtils
;
import
com.pica.cloud.account.account.server.util.TokenUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.io.ByteArrayOutputStream
;
import
java.io.DataOutputStream
;
import
java.io.IOException
;
import
java.util.Date
;
import
java.util.concurrent.ExecutorService
;
@Service
public
class
RegisterServiceImpl
implements
RegisterService
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
@Autowired
private
AccountInfoDetailMapper
accountInfoDetailMapper
;
@Autowired
private
AccountPatientInfoMapper
accountUserInfoMapper
;
@Autowired
private
AccountMapper
accountMapper
;
@Autowired
private
AccountLogUtils
picaLogUtils
;
@Autowired
private
AccountUtils
accountUtils
;
@Autowired
private
TokenUtils
tokenUtils
;
@Autowired
private
QueueProducer
queueProducer
;
@Autowired
private
AgreementEntityMapper
agreementEntityMapper
;
@Autowired
private
AgreementLogEntityMapper
agreementLogEntityMapper
;
@Autowired
private
DoctorMapper
doctorMapper
;
/**
* 1)注册功能:默认未完善信息;
* 2)注册成功后发送mq消息,让别的服务初始化数据;
* 3)记录登录日志;
*
* @param baseRequest 参数模型
* @return
*/
@Override
public
LoginResult
register
(
BaseRequest
baseRequest
)
{
String
mobile
=
baseRequest
.
getMobile
();
String
mobileEncrypt
=
AESUtil
.
encryptV0
(
mobile
);
AccountInfoEntity
accountInfoEntity
=
accountInfoDetailMapper
.
selectByMobile
(
mobileEncrypt
);
if
(
accountInfoEntity
==
null
)
{
Date
currentTime
=
new
Date
();
int
productType
=
baseRequest
.
getProductType
();
int
sourceType
=
baseRequest
.
getSourceType
();
String
password
=
baseRequest
.
getPassword
();
AccountInfoEntity
accountInfo
=
new
AccountInfoEntity
();
accountInfo
.
setMobilePhone
(
mobileEncrypt
);
if
(
StringUtils
.
isEmpty
(
password
))
{
password
=
""
;
}
accountInfo
.
setPassword
(
password
);
accountInfo
.
setCreatedTime
(
currentTime
);
accountInfo
.
setCreatedId
(
0
);
accountInfo
.
setModifiedId
(
0
);
accountInfo
.
setModifiedTime
(
currentTime
);
accountInfo
.
setRegTime
(
currentTime
);
accountInfo
.
setDeleteFlag
(
1
);
accountInfo
.
setSex
(
0
);
accountInfo
.
setRegisterProduct
(
productType
);
accountInfo
.
setRegisterSource
(
sourceType
);
accountInfoDetailMapper
.
insertSelective
(
accountInfo
);
Integer
acctId
=
accountInfo
.
getId
();
accountInfoDetailMapper
.
updateCreateInfo
(
acctId
);
if
(
productType
==
AccountTypeEnum
.
PRODUCT_TYPE_HEALTH
.
getCode
())
{
AccountPatientInfoEntity
accountPatientInfoEntity
=
new
AccountPatientInfoEntity
();
accountPatientInfoEntity
.
setAcctId
(
acctId
);
accountPatientInfoEntity
.
setDeleteFlag
(
1
);
accountPatientInfoEntity
.
setCreateId
(
acctId
);
accountPatientInfoEntity
.
setModifyId
(
acctId
);
accountPatientInfoEntity
.
setCreateTime
(
currentTime
);
accountPatientInfoEntity
.
setModifyTime
(
currentTime
);
accountUserInfoMapper
.
insertSelective
(
accountPatientInfoEntity
);
}
else
{
Account
account
=
new
Account
();
account
.
setAcctId
(
acctId
);
account
.
setMobilePhone
(
mobileEncrypt
);
account
.
setDeleteFlag
(
1
);
account
.
setCreatId
(
0L
);
account
.
setModifyId
(
0L
);
account
.
setCreatTime
(
currentTime
);
account
.
setModifyTime
(
currentTime
);
account
.
setFirstLoginTime
(
currentTime
);
account
.
setLastLoginTime
(
currentTime
);
account
.
setPassword
(
password
);
accountMapper
.
insertSelective
(
account
);
}
Long
userId
=
accountUtils
.
getUserIdByAcctId
(
productType
,
acctId
);
Account
account
=
new
Account
();
account
.
setId
(
userId
);
account
.
setAcctId
(
acctId
);
account
.
setCreatTime
(
currentTime
);
account
.
setMobilePhone
(
mobile
);
account
.
setRegisterSource
(
sourceType
);
String
newToken
=
tokenUtils
.
generateToken
(
account
);
LoginResult
result
=
new
LoginResult
();
result
.
setToken
(
newToken
);
result
.
setUserId
(
userId
);
result
.
setEntireFlag
(
1
);
ByteArrayOutputStream
bos
=
new
ByteArrayOutputStream
();
DataOutputStream
dos
=
new
DataOutputStream
(
bos
);
try
{
dos
.
writeLong
(
userId
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
queueProducer
.
send
(
bos
.
toByteArray
());
LogLoginEntity
entity
=
AccountLogEntityUtils
.
getLogLoginEntity
(
acctId
,
productType
,
baseRequest
.
getSourceType
(),
AccountTypeEnum
.
LOGIN_REGISTER
.
getCode
(),
baseRequest
.
getLoginIp
(),
AccountTypeEnum
.
LOGIN_STATUS_SUCCESS
.
getCode
(),
AccountTypeEnum
.
LOG_TYPE_LOGIN
.
getCode
());
picaLogUtils
.
info
(
entity
);
processAgreement
(
userId
);
return
result
;
}
else
{
throw
new
AccountException
(
AccountExceptionEnum
.
PICA_ALREADY_REGISTER
);
}
}
/**
* 长海项目医生自动注册,并完善信息
*
* @param request
*/
@Override
public
void
ocinRegister
(
OCINRequest
request
)
{
String
mobile
=
request
.
getMobile
();
AccountInfoEntity
accountInfoEntity
=
accountInfoDetailMapper
.
selectByMobile
(
mobile
);
if
(
accountInfoEntity
==
null
)
{
Date
currentTime
=
new
Date
();
int
productType
=
request
.
getProductType
();
int
sourceType
=
request
.
getSourceType
();
AccountInfoEntity
accountInfo
=
new
AccountInfoEntity
();
accountInfo
.
setMobilePhone
(
mobile
);
accountInfo
.
setPassword
(
""
);
accountInfo
.
setCreatedTime
(
currentTime
);
accountInfo
.
setCreatedId
(
0
);
accountInfo
.
setModifiedId
(
0
);
accountInfo
.
setModifiedTime
(
currentTime
);
accountInfo
.
setRegTime
(
currentTime
);
accountInfo
.
setDeleteFlag
(
1
);
accountInfo
.
setSex
(
0
);
accountInfo
.
setRegisterProduct
(
productType
);
accountInfo
.
setRegisterSource
(
sourceType
);
accountInfoDetailMapper
.
insertSelective
(
accountInfo
);
Integer
acctId
=
accountInfo
.
getId
();
accountInfoDetailMapper
.
updateCreateInfo
(
acctId
);
//数据插入医生表中
Account
account
=
new
Account
();
account
.
setAcctId
(
acctId
);
account
.
setMobilePhone
(
mobile
);
account
.
setDeleteFlag
(
1
);
account
.
setCreatId
(
0L
);
account
.
setModifyId
(
0L
);
account
.
setCreatTime
(
currentTime
);
account
.
setModifyTime
(
currentTime
);
account
.
setFirstLoginTime
(
currentTime
);
account
.
setLastLoginTime
(
currentTime
);
account
.
setPassword
(
""
);
accountMapper
.
insertSelective
(
account
);
Long
userId
=
accountUtils
.
getUserIdByAcctId
(
productType
,
acctId
);
processAgreement
(
userId
);
/*PrefectInfoReq prefectInfoReq = new PrefectInfoReq();
prefectInfoReq.setDoctorId(userId);
prefectInfoReq.setHospitalId(request.getHospitalId().longValue());
prefectInfoReq.setName(request.getName());
doctorServiceClient.prefectInfo(prefectInfoReq);
*/
}
else
{
throw
new
AccountException
(
AccountExceptionEnum
.
PICA_ALREADY_REGISTER
.
getCode
(),
AccountExceptionEnum
.
PICA_ALREADY_REGISTER
.
getCode
());
}
}
/**
* 异步处理协议信息
* 1)从协议表中获取最新的协议信息;
* 2)将协议加入到用户协议表中
*/
private
void
processAgreement
(
Long
userId
)
{
ExecutorService
executor
=
ExecutorServiceUtils
.
getExecutor
();
executor
.
submit
(()
->
{
//用户协议
Date
currentTime
=
new
Date
();
Integer
userVersion
=
agreementEntityMapper
.
selectByType
(
AccountAgreementEnum
.
USER_AGREEMENT
.
getCode
());
AgreementLogEntity
userAgreementLogEntity
=
new
AgreementLogEntity
();
userAgreementLogEntity
.
setAgreement_type
(
AccountAgreementEnum
.
USER_AGREEMENT
.
getCode
());
userAgreementLogEntity
.
setDoctor_id
(
userId
);
userAgreementLogEntity
.
setVersion
(
userVersion
.
toString
());
userAgreementLogEntity
.
setCreated_id
(
userId
);
userAgreementLogEntity
.
setCreated_time
(
currentTime
);
userAgreementLogEntity
.
setModified_id
(
userId
);
userAgreementLogEntity
.
setModified_time
(
currentTime
);
userAgreementLogEntity
.
setDelete_flag
(
1
);
agreementLogEntityMapper
.
insert
(
userAgreementLogEntity
);
//隐私协议
Integer
privateVersion
=
agreementEntityMapper
.
selectByType
(
AccountAgreementEnum
.
PRIVACY_AGREEMENT
.
getCode
());
AgreementLogEntity
privateAgreementLogEntity
=
new
AgreementLogEntity
();
privateAgreementLogEntity
.
setAgreement_type
(
AccountAgreementEnum
.
PRIVACY_AGREEMENT
.
getCode
());
privateAgreementLogEntity
.
setDoctor_id
(
userId
);
privateAgreementLogEntity
.
setVersion
(
privateVersion
.
toString
());
privateAgreementLogEntity
.
setCreated_id
(
userId
);
privateAgreementLogEntity
.
setCreated_time
(
currentTime
);
privateAgreementLogEntity
.
setModified_id
(
userId
);
privateAgreementLogEntity
.
setModified_time
(
currentTime
);
privateAgreementLogEntity
.
setDelete_flag
(
1
);
agreementLogEntityMapper
.
insert
(
privateAgreementLogEntity
);
});
}
}
server/src/main/java/com/pica/cloud/account/account/server/service/impl/TokenServiceImpl.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
service
.
impl
;
import
com.pica.cloud.account.account.server.constants.Constants
;
import
com.pica.cloud.account.account.server.service.TokenService
;
import
com.pica.cloud.foundation.entity.PicaResponse
;
import
com.pica.cloud.foundation.redis.ICacheClient
;
import
com.pica.cloud.foundation.utils.entity.PicaUser
;
import
com.pica.cloud.foundation.utils.utils.CommonUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.util.Date
;
import
java.util.Map
;
import
java.util.UUID
;
import
static
com
.
pica
.
cloud
.
foundation
.
utils
.
utils
.
json
.
Object2Map
.
objectToMapString
;
/**
* Created on 2019/9/11 13:10
* author:crs
* Description:获取随机token
*/
@Service
public
class
TokenServiceImpl
implements
TokenService
{
@Autowired
@Qualifier
(
"cacheMigrateClient"
)
private
ICacheClient
redisClient
;
@Override
public
String
getToken
(
Map
<
String
,
Object
>
headersMap
)
{
String
mobile
=
new
StringBuilder
(
"9"
).
append
(
CommonUtil
.
getRandom
(
10
)).
toString
();
headersMap
.
put
(
Constants
.
HEADER_MOBILE
,
mobile
);
if
(!
CollectionUtils
.
isEmpty
(
headersMap
))
{
PicaUser
picaUser
=
new
PicaUser
();
picaUser
.
setCreated_time
(
new
Date
());
picaUser
.
setMobile
((
String
)
headersMap
.
get
(
Constants
.
HEADER_MOBILE
));
picaUser
.
setName
(
Constants
.
HEADER_USER_TYPE
);
picaUser
.
setId
(
0
);
picaUser
.
setBrowser_ver
((
String
)
headersMap
.
get
(
Constants
.
HEADER_BROWSER
));
picaUser
.
setOs_name
((
String
)
headersMap
.
get
(
Constants
.
HEADER_OPERATOR_SYSTEM
));
picaUser
.
setTerminal_type
((
String
)
headersMap
.
get
(
Constants
.
HEADER_TERMINAL_TYPE
));
picaUser
.
setIp_addr
((
String
)
headersMap
.
get
(
Constants
.
HEADER_IP
));
try
{
Map
<
String
,
String
>
map
=
objectToMapString
(
Constants
.
TIME_FORMAT
,
picaUser
,
new
String
[
0
]);
map
.
put
(
Constants
.
HEADER_SYS_CODE
,
Constants
.
HEADER_SYS_SOURCE
);
map
.
put
(
Constants
.
HEADER_GUEST_ID
,
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
).
toUpperCase
());
String
token
=
redisClient
.
saveToken
(
map
,
21600
);
return
token
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
return
null
;
}
}
server/src/main/java/com/pica/cloud/account/account/server/util/AESUtil.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
util
;
import
com.pica.cloud.foundation.utils.utils.EncryptCreateUtil
;
import
org.apache.commons.codec.binary.Base64
;
import
org.apache.commons.lang.StringUtils
;
import
sun.misc.BASE64Decoder
;
import
javax.crypto.Cipher
;
import
javax.crypto.KeyGenerator
;
import
javax.crypto.spec.SecretKeySpec
;
import
java.math.BigInteger
;
/**
* Created on 2019/10/21 13:20
* author:crs
* Description:AESUtil
*/
public
class
AESUtil
{
//密钥 (需要前端和后端保持一致)
private
static
final
String
KEY
=
"abcdefgabcdefg12"
;
//算法
private
static
final
String
ALGORITHMSTR
=
"AES/ECB/PKCS5Padding"
;
/**
* aes解密
* @param encrypt 内容
* @return
* @throws Exception
public static String aesDecrypt(String encrypt) {
try {
return aesDecrypt(encrypt, KEY);
} catch (Exception e) {
e.printStackTrace();
return "";
}
}
*/
/**
* aes加密
* @param content
* @return
* @throws Exception
public static String aesEncrypt(String content) {
try {
return aesEncrypt(content, KEY);
} catch (Exception e) {
e.printStackTrace();
return "";
}
}
*/
/**
* 将byte[]转为各种进制的字符串
* @param bytes byte[]
* @param radix 可以转换进制的范围,从Character.MIN_RADIX到Character.MAX_RADIX,超出范围后变为10进制
* @return 转换后的字符串
*/
public
static
String
binary
(
byte
[]
bytes
,
int
radix
){
return
new
BigInteger
(
1
,
bytes
).
toString
(
radix
);
// 这里的1代表正数
}
/**
* base 64 encode
* @param bytes 待编码的byte[]
* @return 编码后的base 64 code
*/
public
static
String
base64Encode
(
byte
[]
bytes
){
return
Base64
.
encodeBase64String
(
bytes
);
}
/**
* base 64 decode
* @param base64Code 待解码的base 64 code
* @return 解码后的byte[]
* @throws Exception
*/
public
static
byte
[]
base64Decode
(
String
base64Code
)
throws
Exception
{
return
StringUtils
.
isEmpty
(
base64Code
)
?
null
:
new
BASE64Decoder
().
decodeBuffer
(
base64Code
);
}
/**
* AES加密
* @param content 待加密的内容
* @param encryptKey 加密密钥
* @return 加密后的byte[]
* @throws Exception
*/
public
static
byte
[]
aesEncryptToBytes
(
String
content
,
String
encryptKey
)
throws
Exception
{
KeyGenerator
kgen
=
KeyGenerator
.
getInstance
(
"AES"
);
kgen
.
init
(
128
);
Cipher
cipher
=
Cipher
.
getInstance
(
ALGORITHMSTR
);
cipher
.
init
(
Cipher
.
ENCRYPT_MODE
,
new
SecretKeySpec
(
encryptKey
.
getBytes
(),
"AES"
));
return
cipher
.
doFinal
(
content
.
getBytes
(
"utf-8"
));
}
/**
* AES加密为base 64 code
* @param content 待加密的内容
* @param encryptKey 加密密钥
* @return 加密后的base 64 code
* @throws Exception
*/
public
static
String
aesEncrypt
(
String
content
,
String
encryptKey
)
throws
Exception
{
return
base64Encode
(
aesEncryptToBytes
(
content
,
encryptKey
));
}
/**
* AES解密
* @param encryptBytes 待解密的byte[]
* @param decryptKey 解密密钥
* @return 解密后的String
* @throws Exception
*/
public
static
String
aesDecryptByBytes
(
byte
[]
encryptBytes
,
String
decryptKey
)
throws
Exception
{
KeyGenerator
kgen
=
KeyGenerator
.
getInstance
(
"AES"
);
kgen
.
init
(
128
);
Cipher
cipher
=
Cipher
.
getInstance
(
ALGORITHMSTR
);
cipher
.
init
(
Cipher
.
DECRYPT_MODE
,
new
SecretKeySpec
(
decryptKey
.
getBytes
(),
"AES"
));
byte
[]
decryptBytes
=
cipher
.
doFinal
(
encryptBytes
);
return
new
String
(
decryptBytes
);
}
/**
* 将base 64 code AES解密
* @param encryptStr 待解密的base 64 code
* @param decryptKey 解密密钥
* @return 解密后的string
* @throws Exception
*/
public
static
String
aesDecrypt
(
String
encryptStr
,
String
decryptKey
)
throws
Exception
{
return
StringUtils
.
isEmpty
(
encryptStr
)
?
null
:
aesDecryptByBytes
(
base64Decode
(
encryptStr
),
decryptKey
);
}
/**
* 旧的加解密逻辑
* @param data
* @return
*/
public
static
String
encryptV0
(
String
data
)
{
return
EncryptCreateUtil
.
encrypt
(
data
);
}
public
static
String
decryptV0
(
String
data
)
{
return
EncryptCreateUtil
.
dencrypt
(
data
);
}
/**
* 测试
*/
public
static
void
main
(
String
[]
args
)
throws
Exception
{
String
KEY
=
"zJJ$c5md3$yuuhWW"
;
String
content
=
"12322222222"
;
System
.
out
.
println
(
"加密前:"
+
content
);
System
.
out
.
println
(
"加密密钥和解密密钥:"
+
KEY
);
String
encrypt
=
aesEncrypt
(
content
,
KEY
);
System
.
out
.
println
(
"加密后:"
+
encrypt
);
String
decrypt
=
aesDecrypt
(
encrypt
,
KEY
);
System
.
out
.
println
(
"解密后:"
+
decrypt
);
}
}
server/src/main/java/com/pica/cloud/account/account/server/util/AccountUtils.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
util
;
import
com.alibaba.fastjson.JSONObject
;
import
com.pica.cloud.account.account.server.entity.AccountPatientInfoEntity
;
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.mapper.AccountPatientInfoMapper
;
import
com.pica.cloud.account.account.server.mapper.DoctorMapper
;
import
com.pica.cloud.foundation.entity.PicaException
;
import
com.pica.cloud.foundation.entity.PicaResultCode
;
import
com.pica.cloud.foundation.redis.ICacheClient
;
import
com.pica.cloud.foundation.utils.utils.ValidateUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.stereotype.Component
;
/**
* 账户工具类
*/
@Component
public
class
AccountUtils
{
@Autowired
@Qualifier
(
"cacheMigrateClient"
)
private
ICacheClient
cacheClient
;
@Autowired
private
AccountPatientInfoMapper
accountPatientInfoMapper
;
@Autowired
private
DoctorMapper
doctorInfoMapper
;
private
static
final
String
AUTH_CODE_PREFIX
=
"authCode-"
;
private
static
final
String
AUTH_CODE_COUNT_PREFIX
=
"authCode-count-"
;
//手机格式校验
public
static
void
checkMobilePhone
(
String
mobilePhone
)
{
if
(
StringUtils
.
isBlank
(
mobilePhone
)
||
!
ValidateUtils
.
isMobile
(
mobilePhone
))
{
throw
new
PicaException
(
PicaResultCode
.
PARAM_IS_INVALID
.
code
(),
"请输入正确的手机号"
);
}
}
//手机格式校验
public
static
void
checkPassword
(
String
password
)
{
if
(
StringUtils
.
isBlank
(
password
))
{
throw
new
PicaException
(
AccountExceptionEnum
.
PICA_NOT_EMPTY
.
getCode
(),
AccountExceptionEnum
.
PICA_NOT_EMPTY
.
getMessage
());
}
}
//获取验证码redis key
public
static
String
getAuthCodeKey
(
String
mobilePhone
,
String
flag
)
{
return
AUTH_CODE_PREFIX
+
flag
+
"-"
+
AESUtil
.
encryptV0
(
mobilePhone
);
}
//校验验证码
public
void
checkAuthCode
(
String
mobile
,
String
type
,
String
sysCode
)
{
String
flag
=
org
.
apache
.
commons
.
lang
.
StringUtils
.
isBlank
(
type
)
?
"0"
:
type
;
if
(
org
.
apache
.
commons
.
lang
.
StringUtils
.
isBlank
(
sysCode
))
{
throw
new
PicaException
(
PicaResultCode
.
PARAM_IS_INVALID
.
code
(),
"短信验证码错误"
);
}
String
authCodeKey
=
AccountUtils
.
getAuthCodeKey
(
mobile
,
flag
);
String
cacheCode
=
cacheClient
.
get
(
authCodeKey
);
//从redis获取验证码
if
(
org
.
apache
.
commons
.
lang
.
StringUtils
.
isBlank
(
cacheCode
))
{
throw
new
PicaException
(
PicaResultCode
.
RESULE_DATA_NONE
.
code
(),
"短信验证码已过期,请重新获取"
);
}
if
(!
org
.
apache
.
commons
.
lang
.
StringUtils
.
equals
(
sysCode
,
cacheCode
))
{
throw
new
PicaException
(
PicaResultCode
.
PARAM_IS_INVALID
.
code
(),
"短信验证码错误"
);
}
//清除验证码
cacheClient
.
del
(
authCodeKey
);
}
//手机号和验证码校验
public
void
checkMobilePhoneAndAuthCode
(
String
mobile
,
String
type
,
String
sysCode
)
{
if
(
StringUtils
.
isBlank
(
mobile
)
||
!
ValidateUtils
.
isMobile
(
mobile
))
{
throw
new
PicaException
(
PicaResultCode
.
PARAM_IS_INVALID
.
code
(),
"请输入正确的手机号"
);
}
String
flag
=
org
.
apache
.
commons
.
lang
.
StringUtils
.
isBlank
(
type
)
?
"0"
:
type
;
if
(
org
.
apache
.
commons
.
lang
.
StringUtils
.
isBlank
(
sysCode
))
{
throw
new
PicaException
(
PicaResultCode
.
PARAM_IS_INVALID
.
code
(),
"短信验证码错误"
);
}
String
authCodeKey
=
AccountUtils
.
getAuthCodeKey
(
mobile
,
flag
);
//验证码3次校验测试不通过,直接删除
String
authCodeCount
=
AUTH_CODE_COUNT_PREFIX
+
flag
+
"-"
+
AESUtil
.
encryptV0
(
mobile
);
if
(
cacheClient
.
exists
(
authCodeCount
)
&&
Integer
.
parseInt
(
cacheClient
.
get
(
authCodeCount
))
>
2
)
{
cacheClient
.
del
(
authCodeKey
);
}
String
cacheCode
=
cacheClient
.
get
(
authCodeKey
);
//从redis获取验证码
if
(
org
.
apache
.
commons
.
lang
.
StringUtils
.
isBlank
(
cacheCode
))
{
//第四次删除计数器
cacheClient
.
del
(
authCodeCount
);
throw
new
PicaException
(
PicaResultCode
.
RESULE_DATA_NONE
.
code
(),
"短信验证码已失效,请重新获取"
);
}
if
(!
org
.
apache
.
commons
.
lang
.
StringUtils
.
equals
(
sysCode
,
cacheCode
))
{
cacheClient
.
incr
(
authCodeCount
);
throw
new
PicaException
(
PicaResultCode
.
PARAM_IS_INVALID
.
code
(),
"短信验证码错误"
);
}
cacheClient
.
del
(
authCodeKey
);
}
/**
* 请求参数解密、反序列化
*
* @param params
* @param zClass
* @param <T>
* @return
*/
public
static
<
T
>
T
getRequestEntity
(
String
params
,
Class
<
T
>
zClass
)
throws
Exception
{
String
json
=
AESUtil
.
decryptV0
(
params
);
return
JSONObject
.
parseObject
(
json
,
zClass
);
}
/**
* 获取终端来源
*
* @param registerSource
* @return
*/
public
static
String
getSourceType
(
Integer
registerSource
)
{
String
sourceType
=
StringUtils
.
EMPTY
;
switch
(
registerSource
)
{
case
3
:
sourceType
=
"web"
;
break
;
case
4
:
sourceType
=
"h5"
;
break
;
case
5
:
sourceType
=
"admin"
;
break
;
default
:
sourceType
=
"app"
;
}
return
sourceType
;
}
/**
* 通过产品线类型获取用户id
*
* @param productType
* @param AcctId
* @return
*/
public
Long
getUserIdByAcctId
(
Integer
productType
,
Integer
AcctId
)
{
Long
userId
=
null
;
if
(
productType
==
AccountTypeEnum
.
PRODUCT_TYPE_DOCTOR
.
getCode
())
{
userId
=
doctorInfoMapper
.
selectUserIdByAcctId
(
AcctId
);
}
else
if
(
productType
==
AccountTypeEnum
.
PRODUCT_TYPE_HEALTH
.
getCode
())
{
AccountPatientInfoEntity
accountPatientInfoEntity
=
accountPatientInfoMapper
.
selectByAcctId
(
AcctId
);
userId
=
accountPatientInfoEntity
.
getId
().
longValue
();
}
return
userId
;
}
/**
* 校验手机号是否注册过
*
* @param mobile
*/
// public boolean checkRegisterMobile(String mobile) {
// String encrypt = AESUtil.encryptV0(mobile);
// AccountContact accountContact = accountContactServer.selectByMobile(encrypt);
// return (accountContact != null && accountContact.getAcctId() != null);
// }
}
server/src/main/java/com/pica/cloud/account/account/server/util/BeanUtil.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
util
;
import
org.springframework.beans.BeansException
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContextAware
;
import
org.springframework.stereotype.Component
;
@Component
public
class
BeanUtil
implements
ApplicationContextAware
{
private
static
ApplicationContext
context
;
@Override
public
void
setApplicationContext
(
ApplicationContext
paramApplicationContext
)
throws
BeansException
{
context
=
paramApplicationContext
;
}
public
static
ApplicationContext
getContext
()
{
return
context
;
}
public
static
Object
getBean
(
String
beanName
)
{
return
context
.
getBean
(
beanName
);
}
public
static
<
T
>
T
getBean
(
Class
<
T
>
beanClass
)
{
return
context
.
getBean
(
beanClass
);
}
}
server/src/main/java/com/pica/cloud/account/account/server/util/CryptoUtil.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
util
;
import
com.alibaba.fastjson.JSONObject
;
import
com.pica.cloud.account.account.server.entity.EncryptEntity
;
import
com.pica.cloud.account.account.server.req.BaseRequest
;
/**
* 加解密工具类
*/
public
class
CryptoUtil
{
/**
* 加密数据
*
* @param data
* @return
* @throws Exception
*/
// public static EncryptEntity encrypt(String data) throws Exception {
// //1、产生AES密钥
// String keyString = AESUtil.generateKeyString();
// //2、用AES法加密数据
// String content = AESUtil.encrypt(keyString, data);
// //3、用RSA加密AES密钥
// String finalKey = RSAUtil.encrypt(keyString);
// EncryptEntity encryptEntity = new EncryptEntity();
// encryptEntity.setContent(content);
// // TODO: 2019/8/27 :获取验证码接口
//// encryptEntity.setKey(finalKey);
// return encryptEntity;
// }
/**
* 解密数据
*
* @param key
* @param data
* @return
*/
// public static String decrypt(String key, String data) throws Exception {
// //获取解密密钥
// String decryptKey = RSAUtil.decrypt(key);
// //解密数据
// String content = AESUtil.decrypt(decryptKey, data);
// return content;
// }
/**
* 解密数据
*
* @param encryptEntity·
* @return
* @throws Exception
*/
public
static
<
T
>
T
decrypt
(
EncryptEntity
encryptEntity
,
Class
<
T
>
zClass
)
throws
Exception
{
//获取解密密钥
String
decryptKey
=
RSAUtil
.
decrypt
(
encryptEntity
.
getKey
());
//解密数据
String
content
=
AESUtil
.
aesDecrypt
(
encryptEntity
.
getContent
(),
decryptKey
);
//反序列化成对象
T
request
=
JSONObject
.
parseObject
(
content
,
zClass
);
return
request
;
// T request = JSONObject.parseObject(encryptEntity.getContent(), zClass);
// return request;
}
}
server/src/main/java/com/pica/cloud/account/account/server/util/DateEntityUtils.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
util
;
public
class
DateEntityUtils
{
// TODO: 2019/8/29 封装通用性data
// public static <T> T processTime(T t) {
//
//
// }
}
server/src/main/java/com/pica/cloud/account/account/server/util/ExecutorServiceUtils.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
util
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
/**
* Created on 2019/10/11 18:58
* author:crs
* Description:线程池工具类
*/
public
class
ExecutorServiceUtils
{
public
static
ExecutorService
getExecutor
()
{
return
Executors
.
newFixedThreadPool
(
30
);
}
}
server/src/main/java/com/pica/cloud/account/account/server/util/MessageUtils.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
util
;
/**
* Created on 2019/9/11 17:20
* author:crs
* Description:主要用于发送消息
*/
public
class
MessageUtils
{
private
final
static
String
QUEUE_NAME
=
"queue_register"
;
private
final
static
String
EXCHANGE_NAME
=
"exchange_register"
;
}
server/src/main/java/com/pica/cloud/account/account/server/util/MyX509TrustManager.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
util
;
import
javax.net.ssl.X509TrustManager
;
import
java.security.cert.CertificateException
;
import
java.security.cert.X509Certificate
;
/**
* 证书信任管理器(用于https请求)
*
* @author bo.dang
* @date 2014-12-04
*/
public
class
MyX509TrustManager
implements
X509TrustManager
{
public
void
checkClientTrusted
(
X509Certificate
[]
chain
,
String
authType
)
throws
CertificateException
{
}
public
void
checkServerTrusted
(
X509Certificate
[]
chain
,
String
authType
)
throws
CertificateException
{
}
public
X509Certificate
[]
getAcceptedIssuers
()
{
return
null
;
}
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/account/account/server/util/RSAUtil.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
util
;
import
org.apache.tomcat.util.codec.binary.Base64
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.PostConstruct
;
import
javax.crypto.Cipher
;
import
java.security.*
;
import
java.security.interfaces.RSAPrivateKey
;
import
java.security.interfaces.RSAPublicKey
;
import
java.security.spec.PKCS8EncodedKeySpec
;
import
java.security.spec.X509EncodedKeySpec
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* RSA加解密工具类
*/
@Component
public
class
RSAUtil
{
private
static
Map
<
Integer
,
String
>
keyMap
=
new
HashMap
<>();
private
static
String
rsaprivatekey
;
public
static
String
rsapublickey
;
@Value
(
"${rsaprivatekey}"
)
private
String
rsaprivatekeyTemp
;
@Value
(
"${rsapublickey}"
)
public
String
rsapublickeyTemp
;
@PostConstruct
public
void
init
()
{
RSAUtil
.
rsaprivatekey
=
rsaprivatekeyTemp
;
RSAUtil
.
rsapublickey
=
rsapublickeyTemp
;
}
/**
* 加密方法
*
* @param keyString
* @return
*/
public
static
String
encrypt
(
String
keyString
)
throws
Exception
{
return
encrypt
(
keyString
,
rsapublickey
);
}
/**
* 解密方法
*
* @param key
* @return
*/
public
static
String
decrypt
(
String
key
)
throws
Exception
{
return
decrypt
(
key
,
rsaprivatekey
);
}
/**
* 随机生成密钥对
*
* @throws NoSuchAlgorithmException
*/
public
static
void
genKeyPair
()
throws
NoSuchAlgorithmException
{
// KeyPairGenerator类用于生成公钥和私钥对,基于RSA算法生成对象
KeyPairGenerator
keyPairGen
=
KeyPairGenerator
.
getInstance
(
"RSA"
);
// 初始化密钥对生成器,密钥大小为96-1024位
keyPairGen
.
initialize
(
1024
,
new
SecureRandom
());
// 生成一个密钥对,保存在keyPair中
KeyPair
keyPair
=
keyPairGen
.
generateKeyPair
();
RSAPrivateKey
privateKey
=
(
RSAPrivateKey
)
keyPair
.
getPrivate
();
// 得到私钥
RSAPublicKey
publicKey
=
(
RSAPublicKey
)
keyPair
.
getPublic
();
// 得到公钥
String
publicKeyString
=
new
String
(
Base64
.
encodeBase64
(
publicKey
.
getEncoded
()));
// 得到私钥字符串
String
privateKeyString
=
new
String
(
Base64
.
encodeBase64
((
privateKey
.
getEncoded
())));
// 将公钥和私钥保存到Map
keyMap
.
put
(
0
,
publicKeyString
);
//0表示公钥
keyMap
.
put
(
1
,
privateKeyString
);
//1表示私钥
}
/**
* RSA公钥加密
*
* @param str 加密字符串
* @param publicKey 公钥
* @return 密文
* @throws Exception 加密过程中的异常信息
*/
public
static
String
encrypt
(
String
str
,
String
publicKey
)
throws
Exception
{
//base64编码的公钥
byte
[]
decoded
=
Base64
.
decodeBase64
(
publicKey
);
RSAPublicKey
pubKey
=
(
RSAPublicKey
)
KeyFactory
.
getInstance
(
"RSA"
).
generatePublic
(
new
X509EncodedKeySpec
(
decoded
));
//RSA加密
Cipher
cipher
=
Cipher
.
getInstance
(
"RSA"
);
cipher
.
init
(
Cipher
.
ENCRYPT_MODE
,
pubKey
);
String
outStr
=
Base64
.
encodeBase64String
(
cipher
.
doFinal
(
str
.
getBytes
(
"UTF-8"
)));
return
outStr
;
}
/**
* RSA私钥解密
*
* @param str 加密字符串
* @param privateKey 私钥
* @return 铭文
* @throws Exception 解密过程中的异常信息
*/
public
static
String
decrypt
(
String
str
,
String
privateKey
)
throws
Exception
{
//64位解码加密后的字符串
byte
[]
inputByte
=
Base64
.
decodeBase64
(
str
.
getBytes
(
"UTF-8"
));
//base64编码的私钥
byte
[]
decoded
=
Base64
.
decodeBase64
(
privateKey
);
RSAPrivateKey
priKey
=
(
RSAPrivateKey
)
KeyFactory
.
getInstance
(
"RSA"
).
generatePrivate
(
new
PKCS8EncodedKeySpec
(
decoded
));
//RSA解密
Cipher
cipher
=
Cipher
.
getInstance
(
"RSA"
);
cipher
.
init
(
Cipher
.
DECRYPT_MODE
,
priKey
);
String
outStr
=
new
String
(
cipher
.
doFinal
(
inputByte
));
return
outStr
;
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
//生成公钥和私钥
//genKeyPair();
// keyMap.put(0, publicKey);
// keyMap.put(1, privateKey);
// //加密字符串
// String message = "df723820";
// System.out.println("随机生成的公钥为:" + keyMap.get(0));
// System.out.println("随机生成的私钥为:" + keyMap.get(1));
// String messageEn = encrypt(message, keyMap.get(0));
// System.out.println(message + "\t加密后的字符串为:" + messageEn);
// String messageDe = decrypt(messageEn, keyMap.get(1));
// System.out.println("还原后的字符串为:" + messageDe);
genKeyPair
();
String
s
=
keyMap
.
get
(
0
);
System
.
out
.
println
(
s
);
String
s1
=
keyMap
.
get
(
1
);
System
.
out
.
println
(
s1
);
String
key1
=
""
;
String
key2
=
""
;
}
}
server/src/main/java/com/pica/cloud/account/account/server/util/TokenUtils.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
util
;
import
com.pica.cloud.account.account.server.entity.Account
;
import
com.pica.cloud.foundation.redis.ICacheClient
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.stereotype.Component
;
import
java.text.SimpleDateFormat
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.Map
;
import
java.util.UUID
;
/**
* Token工具类
*/
@Component
public
class
TokenUtils
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
@Autowired
@Qualifier
(
"cacheMigrateClient"
)
private
ICacheClient
cacheClient
;
/**
* 校验token的状态
*
* @param token
* @return
*/
public
boolean
checkTokenStatus
(
String
token
)
{
String
str
=
cacheClient
.
get
(
"token-"
+
token
);
return
StringUtils
.
isBlank
(
str
);
}
/**
* 获取新的token
*
* @param account
* @return
*/
public
String
generateToken
(
Account
account
)
{
Integer
registerSource
=
account
.
getRegisterSource
();
String
newToken
=
""
;
try
{
//用户id
String
value
=
"token-doctor-"
+
account
.
getId
().
toString
();
// 根据不同的产品线设置token有效期
int
expiredSeconds
=
24
*
60
*
60
;
if
(
registerSource
!=
3
&&
registerSource
!=
5
)
{
expiredSeconds
=
expiredSeconds
*
30
;
}
newToken
=
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
).
toUpperCase
();
String
Key
=
"token-"
+
newToken
;
//存储token对应的用户id,数据结构如:(token-FF9FCB0D93A642328A01C279701B7607:token-doctor-1)
cacheClient
.
set
(
Key
,
value
,
expiredSeconds
);
//存储不同终端对应的token,数据结构如:(token-doctor-12345678-app:token-FF9FCB0D93A642328A01C279701B7607)
String
sourceType
=
AccountUtils
.
getSourceType
(
registerSource
);
cacheClient
.
set
(
value
+
"-"
+
sourceType
,
Key
,
expiredSeconds
);
//用户数据放入redis缓存
String
userData
=
cacheClient
.
hget
(
value
,
"id"
);
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isEmpty
(
userData
))
{
Map
<
String
,
String
>
data
=
new
HashMap
<>();
data
.
put
(
"token"
,
newToken
);
data
.
put
(
"id"
,
account
.
getId
()
+
""
);
data
.
put
(
"acctId"
,
account
.
getAcctId
()
+
""
);
data
.
put
(
"mobile"
,
account
.
getMobilePhone
());
data
.
put
(
"name"
,
account
.
getMobilePhone
().
replaceAll
(
"(\\d{3})\\d{4}(\\w{4})"
,
"$1****$2"
));
data
.
put
(
"created_time"
,
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
account
.
getCreatTime
()));
data
.
put
(
"sysCode"
,
sourceType
);
Iterator
<
Map
.
Entry
<
String
,
String
>>
iterator
=
data
.
entrySet
().
iterator
();
while
(
iterator
.
hasNext
())
{
Map
.
Entry
<
String
,
String
>
map
=
iterator
.
next
();
String
key
=
map
.
getKey
();
String
valueInfo
=
map
.
getValue
();
//存储token:(token-doctor-1:用户数据)
cacheClient
.
hset
(
value
,
key
,
valueInfo
);
}
}
else
{
cacheClient
.
hset
(
value
,
"token"
,
newToken
);
}
}
catch
(
Exception
ex
)
{
logger
.
error
(
"生成token异常:{}"
+
ex
.
getMessage
(),
ex
);
}
return
newToken
;
}
}
server/src/main/java/com/pica/cloud/account/account/server/util/WeChatToolUtil.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
util
;
import
com.pica.cloud.account.account.server.entity.WeChatEntity
;
import
com.pica.cloud.foundation.utils.constants.WeChatConstants
;
import
com.pica.cloud.foundation.utils.utils.JsonUtil
;
import
com.pica.cloud.foundation.utils.utils.StringUtil
;
import
com.pica.cloud.foundation.utils.utils.date.DateTimeUtils
;
import
net.sf.json.JSONException
;
import
net.sf.json.JSONObject
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Value
;
import
javax.net.ssl.HttpsURLConnection
;
import
javax.net.ssl.SSLContext
;
import
javax.net.ssl.SSLSocketFactory
;
import
javax.net.ssl.TrustManager
;
import
java.io.BufferedReader
;
import
java.io.InputStream
;
import
java.io.InputStreamReader
;
import
java.io.OutputStream
;
import
java.net.ConnectException
;
import
java.net.URL
;
import
java.util.Date
;
//import com.picahealth.common.utils.DateTimeUtils;
//import com.picahealth.common.utils.JsonUtil;
//import com.picahealth.common.utils.StringUtil;
//import com.picahealth.wit.wechat.constants.WeChatConstants;
//import com.picahealth.wit.wechat.entity.AccessToken;
//import com.picahealth.wit.wechat.entity.JsapiTicket;
//import com.picahealth.wit.wechat.entity.Menu;
//import static com.picahealth.wechat.wechat.thread.AccessTokenThread.appid;
//import static com.picahealth.wechat.wechat.thread.AccessTokenThread.appsecret;
//import static com.picahealth.wechat.wechat.thread.AccessTokenThread.appid;
//import static com.picahealth.wechat.wechat.thread.AccessTokenThread.appsecret;
//import static com.picahealth.wechat.wechat.thread.AccessTokenThread.jsapiTicket;
/**
* 公众平台通用接口工具类
*
* @author bo.dang
* @date 2013-08-09
*/
public
class
WeChatToolUtil
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
WeChatToolUtil
.
class
);
/** access_token */
public
static
String
access_token
;
public
static
WeChatEntity
accessToken
;
/** 获取access_token的时间 */
private
static
Date
get_access_token_time
;
/**
* 发起https请求并获取结果
*
* @param requestUrl 请求地址
* @param requestMethod 请求方式(GET、POST)
* @param outputStr 提交的数据
* @return JSONObject(通过JSONObject.get(key)的方式获取json对象的属性值)
*/
public
static
JSONObject
httpRequest
(
String
requestUrl
,
String
requestMethod
,
String
outputStr
)
{
JSONObject
jsonObject
=
null
;
StringBuffer
buffer
=
new
StringBuffer
();
try
{
// 创建SSLContext对象,并使用我们指定的信任管理器初始化
TrustManager
[]
tm
=
{
new
MyX509TrustManager
()
};
SSLContext
sslContext
=
SSLContext
.
getInstance
(
"SSL"
,
"SunJSSE"
);
sslContext
.
init
(
null
,
tm
,
new
java
.
security
.
SecureRandom
());
// 从上述SSLContext对象中得到SSLSocketFactory对象
SSLSocketFactory
ssf
=
sslContext
.
getSocketFactory
();
URL
url
=
new
URL
(
requestUrl
);
HttpsURLConnection
httpUrlConn
=
(
HttpsURLConnection
)
url
.
openConnection
();
httpUrlConn
.
setSSLSocketFactory
(
ssf
);
httpUrlConn
.
setDoOutput
(
true
);
httpUrlConn
.
setDoInput
(
true
);
httpUrlConn
.
setUseCaches
(
false
);
// 设置请求方式(GET/POST)
httpUrlConn
.
setRequestMethod
(
requestMethod
);
if
(
"GET"
.
equalsIgnoreCase
(
requestMethod
))
httpUrlConn
.
connect
();
// 当有数据需要提交时
if
(
null
!=
outputStr
)
{
OutputStream
outputStream
=
httpUrlConn
.
getOutputStream
();
// 注意编码格式,防止中文乱码
outputStream
.
write
(
outputStr
.
getBytes
(
"UTF-8"
));
outputStream
.
close
();
}
// 将返回的输入流转换成字符串
InputStream
inputStream
=
httpUrlConn
.
getInputStream
();
InputStreamReader
inputStreamReader
=
new
InputStreamReader
(
inputStream
,
"utf-8"
);
BufferedReader
bufferedReader
=
new
BufferedReader
(
inputStreamReader
);
String
str
=
null
;
while
((
str
=
bufferedReader
.
readLine
())
!=
null
)
{
buffer
.
append
(
str
);
}
bufferedReader
.
close
();
inputStreamReader
.
close
();
// 释放资源
inputStream
.
close
();
inputStream
=
null
;
httpUrlConn
.
disconnect
();
logger
.
info
(
buffer
.
toString
());
jsonObject
=
JSONObject
.
fromObject
(
buffer
.
toString
());
}
catch
(
ConnectException
ce
)
{
logger
.
error
(
"Weixin server connection timed out."
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"https request error:{}"
,
e
);
}
return
jsonObject
;
}
/**
* 获取access_token
*
* @param appid 凭证
* @param appsecret 密钥
* @return
*/
public
static
WeChatEntity
getAccessToken
(
String
appid
,
String
appsecret
)
{
WeChatEntity
accessToken
=
null
;
String
requestUrl
=
WeChatConstants
.
ACCESS_TOKEN_URL
.
replace
(
"APPID"
,
appid
).
replace
(
"APPSECRET"
,
appsecret
);
JSONObject
jsonObject
=
httpRequest
(
requestUrl
,
"GET"
,
null
);
// 如果请求成功
if
(
null
!=
jsonObject
)
{
try
{
access_token
=
jsonObject
.
getString
(
"access_token"
);
if
(!
StringUtil
.
isEmpty
(
access_token
)){
get_access_token_time
=
new
Date
();
accessToken
=
JsonUtil
.
toGsonBean
(
jsonObject
.
toString
(),
WeChatEntity
.
class
);
/*
accessToken.setAccess_token(jsonObject.getString("access_token"));
accessToken.setExpires_in(jsonObject.getInt("expires_in"));*/
}
else
{
get_access_token_time
=
new
Date
();
}
}
catch
(
JSONException
e
)
{
accessToken
=
null
;
// 获取token失败
logger
.
error
(
"获取token失败 errcode:{} errmsg:{}"
,
jsonObject
.
getInt
(
"errcode"
),
jsonObject
.
getString
(
"errmsg"
));
}
}
else
{
// 获取token失败
logger
.
error
(
"获取token失败 errcode:{} errmsg:{}"
,
jsonObject
.
getInt
(
"errcode"
),
jsonObject
.
getString
(
"errmsg"
));
}
WeChatToolUtil
.
accessToken
=
accessToken
;
return
accessToken
;
}
/**
* 校验accessToken是否过期
* @param access_token
* @return
*/
// public static WeChatEntity checkAccessTokencheckAccessToken(String access_token){
//
//
// WeChatEntity accessToken = WeChatToolUtil.accessToken;
//
// if(WeChatToolUtil.isExpired() || StringUtil.isEmpty(access_token)){
//
// accessToken = WeChatToolUtil.getAccessToken(appId, WeChatConstants.APP_SECRET);
// }
//
//
// return accessToken;
//
// }
// /**
// * 获得jsapi_ticket
// * @return
// */
// public static JsapiTicket getJsapi_ticket(){
//
// //AccessToken accessToken = getAccessToken(WeChatConstants.APP_ID, WeChatConstants.APP_SECRET);
//
// String requestUrl = WeChatConstants.GET_JSAPI_TICKET.replace("ACCESS_TOKEN", access_token);
// JSONObject jsonObject = httpRequest(requestUrl, "GET", null);
// JsapiTicket jsapiTicket = null;
// if(StringUtil.isNotNull(jsonObject)){
// jsapiTicket = JsonUtil.toGsonBean(jsonObject.toString(), JsapiTicket.class);
// }
//
// return jsapiTicket;
//
// }
//
// /**
// * 签名算法
// * @param url
// * @return
// */
// public static Map<String, String> sign(String url){
// //String jsapi_ticket = getJsapi_ticket();
// return Sign.sign(jsapiTicket.getTicket(), url);
// }
//
// /**
// * 创建菜单
// *
// * @param menu 菜单实例
// * @param accessToken 有效的access_token
// * @return 0表示成功,其他值表示失败
// */
// public static int createMenu(Menu menu, String accessToken) {
// int result = 0;
//
// // 拼装创建菜单的url
// String url = WeChatConstants.MENU_CREATE_URL.replace("ACCESS_TOKEN", accessToken);
// // 将菜单对象转换成json字符串
// String jsonMenu = JSONObject.fromObject(menu).toString();
// // 调用接口创建菜单
// JSONObject jsonObject = httpRequest(url, "POST", jsonMenu);
//
// if (null != jsonObject) {
// if (0 != jsonObject.getInt("errcode")) {
// result = jsonObject.getInt("errcode");
// logger.error("创建菜单失败 errcode:{} errmsg:{}", jsonObject.getInt("errcode"), jsonObject.getString("errmsg"));
// }
// }
//
// return result;
// }
// /**
// * 设置所属行业
// *
// * @param menu 菜单实例
// * @param accessToken 有效的access_token
// * @return 0表示成功,其他值表示失败
// */
// public static int setIndustry(, String accessToken) {
// int result = 0;
//
// // 拼装创建菜单的url
// String url = WeChatConstants.MENU_CREATE_URL.replace("ACCESS_TOKEN", accessToken);
// // 将菜单对象转换成json字符串
// String jsonMenu = JSONObject.fromObject(menu).toString();
// // 调用接口创建菜单
// JSONObject jsonObject = httpRequest(url, "POST", jsonMenu);
//
// if (null != jsonObject) {
// if (0 != jsonObject.getInt("errcode")) {
// result = jsonObject.getInt("errcode");
// logger.error("创建菜单失败 errcode:{} errmsg:{}", jsonObject.getInt("errcode"), jsonObject.getString("errmsg"));
// }
// }
//
// return result;
// }
/**
* 判断是否是QQ表情
*
* @param content
* @return
*/
// public static boolean isQqFace(String content) {
// boolean result = false;
//
// // 判断QQ表情的正则表达式
// String qqfaceRegex = "/::\\)|/::~|/::B|/::\\||/:8-\\)|/::<|/::$|/::X|/::Z|/::'\\(|/::-\\||/::@|/::P|/::D|/::O|/::\\(|/::\\+|/:--b|/::Q|/::T|/:,@P|/:,@-D|/::d|/:,@o|/::g|/:\\|-\\)|/::!|/::L|/::>|/::,@|/:,@f|/::-S|/:\\?|/:,@x|/:,@@|/::8|/:,@!|/:!!!|/:xx|/:bye|/:wipe|/:dig|/:handclap|/:&-\\(|/:B-\\)|/:<@|/:@>|/::-O|/:>-\\||/:P-\\(|/::'\\||/:X-\\)|/::\\*|/:@x|/:8\\*|/:pd|/:<W>|/:beer|/:basketb|/:oo|/:coffee|/:eat|/:pig|/:rose|/:fade|/:showlove|/:heart|/:break|/:cake|/:li|/:bome|/:kn|/:footb|/:ladybug|/:shit|/:moon|/:sun|/:gift|/:hug|/:strong|/:weak|/:share|/:v|/:@\\)|/:jj|/:@@|/:bad|/:lvu|/:no|/:ok|/:love|/:<L>|/:jump|/:shake|/:<O>|/:circle|/:kotow|/:turn|/:skip|/:oY|/:#-0|/:hiphot|/:kiss|/:<&|/:&>";
// Pattern p = Pattern.compile(qqfaceRegex);
// Matcher m = p.matcher(content);
// if (m.matches()) {
// result = true;
// }
// return result;
// }
/**
* 判断access_token是否过期
*/
public
static
Boolean
isExpired
(){
if
(
null
!=
get_access_token_time
){
logger
.
info
(
"判断access_token是否过期 get_access_token_time:{} currentTime:{}"
,
DateTimeUtils
.
DateTimeFormater
.
format
(
get_access_token_time
),
DateTimeUtils
.
currentDateTime
());
return
DateTimeUtils
.
compare2Date
(
new
Date
(),
DateTimeUtils
.
addDateSeconds
(
get_access_token_time
,
(
7200
-
60
)
*
1000
));
}
else
{
return
true
;
}
}
// /**
// * 判断access_token是否过期
// */
// public static Boolean isExpired(Date createdAt, Integer expireIn){
// if(null != createdAt){
// logger.info("判断access_token是否过期 createdAt time:{} currentTime:{}", DateTimeUtils.DateTimeFormater.format(createdAt), DateTimeUtils.currentDateTime());
// return DateTimeUtils.compare2Date(new Date(), DateTimeUtils.addDateSeconds(createdAt, (expireIn - 60) * 1000));
// }
// else {
// return true;
// }
// }
/**
* 系统启动时取得AccessToken
* @return
*/
// public static WeChatEntity initWechatAccessToken(String appid, String appsecret){
//
// accessToken = WeChatToolUtil.getAccessToken(appid, appsecret);
// if (null != accessToken) {
// logger.info("获取access_token成功,有效时长{}秒 access_token:{}", accessToken.getExpires_in(), accessToken.getAccess_token());
// // 获取权限签名
// jsapiTicket = WeChatToolUtil.getJsapi_ticket();
// if (StringUtil.isNotNull(jsapiTicket)) {
// logger.info("获取jsapi_ticket成功,有效时长{}秒 jsapi_ticket:{}", jsapiTicket.getExpires_in(), jsapiTicket.getTicket());
// }
// }
//
// return accessToken;
// }
/* // 文本消息
if (msgType.equals(MessageUtil.REQ_MESSAGE_TYPE_TEXT)) {
// 文本消息内容
String content = requestMap.get("Content");
// 判断用户发送的是否是单个QQ表情
if(XiaoqUtil.isQqFace(content)) {
// 回复文本消息
TextMessage textMessage = new TextMessage();
textMessage.setToUserName(fromUserName);
textMessage.setFromUserName(toUserName);
textMessage.setCreateTime(new Date().getTime());
textMessage.setMsgType(MessageUtil.RESP_MESSAGE_TYPE_TEXT);
textMessage.setFuncFlag(0);
// 用户发什么QQ表情,就返回什么QQ表情
textMessage.setContent(content);
// 将文本消息对象转换成xml字符串
respMessage = MessageUtil.textMessageToXml(textMessage);
}
}*/
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/account/account/server/util/WeChatUtils.java
0 → 100644
浏览文件 @
753091e7
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
util
;
import
com.alibaba.fastjson.JSON
;
import
com.pica.cloud.account.account.server.entity.WeChatEntity
;
import
com.pica.cloud.account.account.server.entity.WeChatUserInfoEntity
;
import
com.pica.cloud.foundation.utils.constants.WeChatConstants
;
import
com.pica.cloud.foundation.utils.utils.JsonUtil
;
import
com.pica.cloud.foundation.utils.utils.StringUtil
;
import
net.sf.json.JSONException
;
import
net.sf.json.JSONObject
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.HttpStatus
;
import
org.apache.http.NameValuePair
;
import
org.apache.http.client.methods.HttpGet
;
import
org.apache.http.client.utils.URLEncodedUtils
;
import
org.apache.http.impl.client.HttpClients
;
import
org.apache.http.util.EntityUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.io.IOException
;
import
java.net.URI
;
import
java.net.URISyntaxException
;
import
java.net.URL
;
import
java.nio.charset.Charset
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
public
class
WeChatUtils
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
WeChatUtils
.
class
);
public
static
WeChatEntity
getAuthorizationInfo
(
String
appId
,
String
appSecret
,
String
code
)
{
logger
.
info
(
"网页授权获取access_token: code:{}"
,
code
);
String
requestUrl
=
WeChatConstants
.
AUTH_ACCESS_TOKEN_URL
.
replace
(
"APPID"
,
appId
).
replace
(
"SECRET"
,
appSecret
).
replace
(
"CODE"
,
code
);
JSONObject
jsonObject
=
WeChatToolUtil
.
httpRequest
(
requestUrl
,
"GET"
,
null
);
WeChatEntity
accessToken
=
null
;
// 如果请求成功
if
(
null
!=
jsonObject
)
{
try
{
accessToken
=
JsonUtil
.
toGsonBean
(
jsonObject
.
toString
(),
WeChatEntity
.
class
);
logger
.
info
(
"网页授权获取access_token: access_token:{} openid:{}"
,
accessToken
.
getAccess_token
(),
accessToken
.
getOpenid
());
}
catch
(
JSONException
e
)
{
// 获取token失败
logger
.
error
(
"获取token失败 errcode:{} errmsg:{}"
,
jsonObject
.
getInt
(
"errcode"
),
jsonObject
.
getString
(
"errmsg"
));
}
}
else
{
// 获取token失败
logger
.
error
(
"获取token失败 errcode:{} errmsg:{}"
,
jsonObject
.
getInt
(
"errcode"
),
jsonObject
.
getString
(
"errmsg"
));
}
return
accessToken
;
}
public
static
Map
getWeChatUserInfo
(
Map
map
,
String
url
)
{
String
param
=
"access_token="
+
map
.
get
(
"access_token"
)
+
"&openid="
+
map
.
get
(
"openid"
)
+
"&lang=zh_CN"
;
List
<
NameValuePair
>
nameValuePairs
=
URLEncodedUtils
.
parse
(
param
,
Charset
.
forName
(
"utf-8"
));
HttpGet
method
=
null
;
try
{
url
=
url
+
param
;
URL
url1
=
new
URL
(
url
);
URI
uri
=
new
URI
(
url1
.
getProtocol
(),
url1
.
getHost
(),
url1
.
getPath
(),
url1
.
getQuery
(),
null
);
method
=
new
HttpGet
(
uri
);
// 建立一个NameValuePair数组,用于存储欲传送的参数
method
.
addHeader
(
"Content-type"
,
"application/json; charset=utf-8"
);
method
.
setHeader
(
"Accept"
,
"application/json"
);
HttpResponse
response
=
HttpClients
.
createDefault
().
execute
(
method
);
int
statusCode
=
response
.
getStatusLine
().
getStatusCode
();
if
(
statusCode
==
HttpStatus
.
SC_OK
)
{
String
body
=
EntityUtils
.
toString
(
response
.
getEntity
(),
"utf-8"
);
return
JSON
.
parseObject
(
body
,
Map
.
class
);
}
else
{
logger
.
warn
(
"微信获取用户信息(包括UnionID)失败,param:{}, result:{}"
,
JSON
.
toJSONString
(
map
),
JSON
.
toJSONString
(
response
));
return
new
HashMap
();
}
}
catch
(
IOException
e
)
{
logger
.
error
(
"微信获取access_token异常,param:{}"
,
JSON
.
toJSONString
(
map
),
e
);
return
new
HashMap
();
}
catch
(
URISyntaxException
e
)
{
logger
.
error
(
"异常抛出exception "
,
e
);
}
finally
{
if
(
method
!=
null
)
{
method
.
releaseConnection
();
}
}
return
new
HashMap
();
}
public
static
WeChatUserInfoEntity
mergeWechatUserInfo
(
Map
map
,
String
openid
){
WeChatUserInfoEntity
user
=
new
WeChatUserInfoEntity
();
user
.
setOpenid
(
openid
);
user
.
setLanguage
(
"zh_CN"
);
if
(
StringUtil
.
isNotNull
(
map
)
&&
map
.
size
()
>
0
)
{
user
.
setSubscribe
((
Integer
)
map
.
get
(
"subscribe"
));
user
.
setNickname
((
String
)
(
map
.
get
(
"nickname"
)));
user
.
setSex
((
Integer
)
map
.
get
(
"sex"
));
user
.
setLanguage
((
String
)
map
.
get
(
"language"
));
user
.
setCity
((
String
)
map
.
get
(
"city"
));
user
.
setProvince
((
String
)
map
.
get
(
"province"
));
user
.
setCountry
((
String
)
map
.
get
(
"country"
));
user
.
setHeadimgurl
((
String
)
map
.
get
(
"headimgurl"
));
user
.
setSubscribe_time
(
new
Date
(
map
.
get
(
"subscribe_time"
)
==
null
?
1501052712L
:
Long
.
valueOf
(
map
.
get
(
"subscribe_time"
).
toString
())));
user
.
setRemark
((
String
)
map
.
get
(
"remark"
));
user
.
setUnionid
((
String
)
map
.
get
(
"unionid"
));
user
.
setGroupid
((
Integer
)
map
.
get
(
"groupid"
));
user
.
setTagid_list
(
JSON
.
toJSONString
(
map
.
get
(
"tagid_list"
)));
}
return
user
;
}
}
server/src/main/resources/bootstrap-dev.properties
浏览文件 @
753091e7
server.port
=
13201
server.port
=
13201
server.context-path
=
/account
server.context-path
=
/account
spring.application.name
=
${server.port}-pica-cloud-account
spring.application.name
=
${server.port}-pica-cloud-account
#config server settings
#config server settings
spring.cloud.config.name
=
com.pica.cloud.account
spring.cloud.config.name
=
com.pica.cloud.account
spring.cloud.config.profile
=
dev
spring.cloud.config.profile
=
dev
...
@@ -9,6 +8,9 @@ spring.cloud.config.label=publish
...
@@ -9,6 +8,9 @@ spring.cloud.config.label=publish
spring.cloud.config.discovery.enabled
=
true
spring.cloud.config.discovery.enabled
=
true
spring.cloud.config.discovery.service-id
=
config-server
spring.cloud.config.discovery.service-id
=
config-server
spring.data.mongodb.uri
=
mongodb://pica_user:2wsx3edc@192.168.140.30:27017/picadb
spring.application.doctor.name
=
11101-pica-cloud-doctor
#eureka settings
#eureka settings
eureka.instance.instance-id
=
${spring.cloud.client.ipAddress}:${server.port}
eureka.instance.instance-id
=
${spring.cloud.client.ipAddress}:${server.port}
eureka.client.service-url.defaultZone
=
http://192.168.110.120:7891/eureka/,http://192.168.110.121:7891/eureka/
eureka.client.service-url.defaultZone
=
http://192.168.110.120:7891/eureka/,http://192.168.110.121:7891/eureka/
...
@@ -17,21 +19,31 @@ eureka.instance.lease-renewal-interval-in-seconds=10
...
@@ -17,21 +19,31 @@ eureka.instance.lease-renewal-interval-in-seconds=10
eureka.instance.lease-expiration-duration-in-seconds
=
10
eureka.instance.lease-expiration-duration-in-seconds
=
10
eureka.instance.hostname
=
${spring.cloud.client.ipAddress}
eureka.instance.hostname
=
${spring.cloud.client.ipAddress}
eureka.instance.prefer-ip-address
=
true
eureka.instance.prefer-ip-address
=
true
#logback settings
#logback settings
logging.level.ROOT
=
INFO
logging.level.ROOT
=
INFO
logging.path
=
c:/tomcat-log/${spring.application.name}
logging.path
=
c:/tomcat-log/${spring.application.name}
#job settings
#job settings
#xxl.job.executor.appname=pica-cloud-${server.port}-account-job
#xxl.job.executor.appname=pica-cloud-${server.port}-account-job
#feign settings
#feign settings
#feign.hystrix.enabled=false
#feign.hystrix.enabled=false
ribbon.ReadTimeout
=
120000
ribbon.ReadTimeout
=
120000
ribbon.ConnectTimeout
=
60000
ribbon.ConnectTimeout
=
60000
#------------ Please don't change above configurations ------------
#------------ Please don't change above configurations ------------
spring.jackson.date-format
=
yyyy-MM-dd HH:mm:ss
spring.jackson.date-format
=
yyyy-MM-dd HH:mm:ss
spring.jackson.time-zone
=
GMT+8
spring.jackson.time-zone
=
GMT+8
#spring.jackson.default-property-inclusion=non_null
memcached.url
=
192.168.130.230:11211
memcached.url
=
192.168.130.230:11211
#微信登陆
weChatAppID
=
wx5103ed453ef2dbe8
weChatAppSecret
=
6faa9bef3302786c08b2baf278613f38
weChatURL
=
https://api.weixin.qq.com/sns/userinfo?
#是否开启双写模式,是否需要向p_doctor表写数据
doubleWritingMode
=
true
#rabbitmq settings
spring.rabbitmq.host
=
192.168.110.206
spring.rabbitmq.port
=
5672
spring.rabbitmq.username
=
appuser
spring.rabbitmq.password
=
AqLfvyWOvLQEUzdI
spring.rabbitmq.virtual-host
=
account-register-vhost
\ No newline at end of file
server/src/main/resources/bootstrap-prod.properties
浏览文件 @
753091e7
server.port
=
13201
server.port
=
13201
server.context-path
=
/account
server.context-path
=
/account
spring.application.name
=
${server.port}-pica-cloud-account
spring.application.name
=
${server.port}-pica-cloud-account
spring.application.doctor.name
=
11101-pica-cloud-doctor
#config server settings
#config server settings
spring.cloud.config.name
=
com.pica.cloud.account
spring.cloud.config.name
=
com.pica.cloud.account
...
@@ -35,3 +36,12 @@ spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
...
@@ -35,3 +36,12 @@ spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.time-zone
=
GMT+8
spring.jackson.time-zone
=
GMT+8
memcached.url
=
172.19.121.31:11211
memcached.url
=
172.19.121.31:11211
#微信登陆
weChatAppID
=
wx5103ed453ef2dbe8
weChatAppSecret
=
6faa9bef3302786c08b2baf278613f38
weChatURL
=
https://api.weixin.qq.com/sns/userinfo?
#是否开启双写模式,是否需要向p_doctor表写数据
doubleWritingMode
=
true
server/src/main/resources/bootstrap-test1.properties
浏览文件 @
753091e7
server.port
=
13201
server.port
=
13201
server.context-path
=
/account
server.context-path
=
/account
spring.application.name
=
${server.port}-pica-cloud-account
spring.application.name
=
${server.port}-pica-cloud-account
spring.application.doctor.name
=
11101-pica-cloud-doctor
#config server settings
#config server settings
spring.cloud.config.name
=
com.pica.cloud.account
spring.cloud.config.name
=
com.pica.cloud.account
spring.cloud.config.profile
=
test1
spring.cloud.config.profile
=
test1
...
@@ -35,3 +35,18 @@ spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
...
@@ -35,3 +35,18 @@ spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.time-zone
=
GMT+8
spring.jackson.time-zone
=
GMT+8
memcached.url
=
192.168.130.230:11211
memcached.url
=
192.168.130.230:11211
#微信登陆
weChatAppID
=
wx5103ed453ef2dbe8
weChatAppSecret
=
6faa9bef3302786c08b2baf278613f38
weChatURL
=
https://api.weixin.qq.com/sns/userinfo?
#是否开启双写模式,是否需要向p_doctor表写数据
doubleWritingMode
=
true
#rabbitmq settings
spring.rabbitmq.host
=
192.168.110.206
spring.rabbitmq.port
=
5672
spring.rabbitmq.username
=
appuser
spring.rabbitmq.password
=
AqLfvyWOvLQEUzdI
spring.rabbitmq.virtual-host
=
account-register-vhost
\ No newline at end of file
server/src/main/resources/bootstrap-test2.properties
浏览文件 @
753091e7
server.port
=
13201
server.port
=
13201
server.context-path
=
/account
server.context-path
=
/account
spring.application.name
=
${server.port}-pica-cloud-account
spring.application.name
=
${server.port}-pica-cloud-account
spring.application.doctor.name
=
11101-pica-cloud-doctor
#config server settings
#config server settings
spring.cloud.config.name
=
com.pica.cloud.account
spring.cloud.config.name
=
com.pica.cloud.account
spring.cloud.config.profile
=
test2
spring.cloud.config.profile
=
test2
...
@@ -35,3 +35,18 @@ spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
...
@@ -35,3 +35,18 @@ spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.time-zone
=
GMT+8
spring.jackson.time-zone
=
GMT+8
memcached.url
=
192.168.130.230:11211
memcached.url
=
192.168.130.230:11211
#微信登陆
weChatAppID
=
wx5103ed453ef2dbe8
weChatAppSecret
=
6faa9bef3302786c08b2baf278613f38
weChatURL
=
https://api.weixin.qq.com/sns/userinfo?
#是否开启双写模式,是否需要向p_doctor表写数据
doubleWritingMode
=
true
#rabbitmq settings
spring.rabbitmq.host
=
192.168.110.206
spring.rabbitmq.port
=
5672
spring.rabbitmq.username
=
appuser
spring.rabbitmq.password
=
AqLfvyWOvLQEUzdI
spring.rabbitmq.virtual-host
=
account-register-vhost
\ No newline at end of file
server/src/main/resources/bootstrap-uat.properties
浏览文件 @
753091e7
server.port
=
13201
server.port
=
13201
server.context-path
=
/account
server.context-path
=
/account
spring.application.name
=
${server.port}-pica-cloud-account
spring.application.name
=
${server.port}-pica-cloud-account
spring.application.doctor.name
=
11101-pica-cloud-doctor
#config server settings
#config server settings
spring.cloud.config.name
=
com.pica.cloud.account
spring.cloud.config.name
=
com.pica.cloud.account
spring.cloud.config.profile
=
uat
spring.cloud.config.profile
=
uat
...
@@ -35,3 +35,18 @@ spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
...
@@ -35,3 +35,18 @@ spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.time-zone
=
GMT+8
spring.jackson.time-zone
=
GMT+8
memcached.url
=
192.168.130.230:11211
memcached.url
=
192.168.130.230:11211
#微信登陆
weChatAppID
=
wx5103ed453ef2dbe8
weChatAppSecret
=
6faa9bef3302786c08b2baf278613f38
weChatURL
=
https://api.weixin.qq.com/sns/userinfo?
#是否开启双写模式,是否需要向p_doctor表写数据
doubleWritingMode
=
true
#rabbitmq settings
spring.rabbitmq.host
=
192.168.110.206
spring.rabbitmq.port
=
5672
spring.rabbitmq.username
=
appuser
spring.rabbitmq.password
=
AqLfvyWOvLQEUzdI
spring.rabbitmq.virtual-host
=
account-register-vhost
\ No newline at end of file
server/src/main/resources/mybatis/AccountInfoEntityMapper.xml
0 → 100644
浏览文件 @
753091e7
<?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.AccountInfoDetailMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pica.cloud.account.account.server.entity.AccountInfoEntity"
>
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<result
column=
"mobile_phone"
property=
"mobilePhone"
jdbcType=
"VARCHAR"
/>
<result
column=
"password"
property=
"password"
jdbcType=
"VARCHAR"
/>
<result
column=
"register_product"
property=
"registerProduct"
jdbcType=
"INTEGER"
/>
<result
column=
"register_source"
property=
"registerSource"
jdbcType=
"INTEGER"
/>
<result
column=
"name"
property=
"name"
jdbcType=
"VARCHAR"
/>
<result
column=
"age"
property=
"age"
jdbcType=
"TINYINT"
/>
<result
column=
"birthday"
property=
"birthday"
jdbcType=
"DATE"
/>
<result
column=
"sex"
property=
"sex"
jdbcType=
"TINYINT"
/>
<result
column=
"id_card"
property=
"idCard"
jdbcType=
"VARCHAR"
/>
<result
column=
"reg_time"
property=
"regTime"
jdbcType=
"TIMESTAMP"
/>
<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, mobile_phone, password, register_product, register_source, name, age, birthday,
sex, id_card, reg_time, 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_info
where id = #{id,jdbcType=INTEGER}
</select>
<!--通过电话号码查询账号信息-->
<select
id=
"selectByMobile"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from account_info
where mobile_phone = #{mobile}
</select>
<!--插入注册人信息-->
<update
id=
"updateCreateInfo"
parameterType=
"com.pica.cloud.account.account.server.entity.AccountInfoEntity"
>
update account_info set created_id=#{acctId}, modified_id=#{acctId} where id=#{acctId}
</update>
<!--更新用户的手机号-->
<update
id=
"updateMobileByPrimaryKey"
parameterType=
"com.pica.cloud.account.account.server.entity.AccountInfoEntity"
>
update account_info set modified_id=#{id}, modified_time=#{modifiedTime},mobile_phone=#{mobilePhone} where id=#{id}
</update>
<!--修改用户的密码-->
<update
id=
"updatePasswordByPrimaryKey"
parameterType=
"com.pica.cloud.account.account.server.entity.AccountInfoEntity"
>
update account_info set modified_id=#{id}, modified_time=now(),password=#{password} where id=#{id}
</update>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer"
>
delete from account_info
where id = #{id,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
parameterType=
"com.pica.cloud.account.account.server.entity.AccountInfoEntity"
>
insert into account_info (id, mobile_phone, password,
register_product, register_source, name,
age, birthday, sex, id_card,
reg_time, delete_flag, created_id,
created_time, modified_id, modified_time
)
values (#{id,jdbcType=INTEGER}, #{mobilePhone,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
#{registerProduct,jdbcType=INTEGER}, #{registerSource,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},
#{age,jdbcType=TINYINT}, #{birthday,jdbcType=DATE}, #{sex,jdbcType=TINYINT}, #{idCard,jdbcType=VARCHAR},
#{regTime,jdbcType=TIMESTAMP}, #{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.AccountInfoEntity"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into account_info
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"mobilePhone != null"
>
mobile_phone,
</if>
<if
test=
"password != null"
>
password,
</if>
<if
test=
"registerProduct != null"
>
register_product,
</if>
<if
test=
"registerSource != null"
>
register_source,
</if>
<if
test=
"name != null"
>
name,
</if>
<if
test=
"age != null"
>
age,
</if>
<if
test=
"birthday != null"
>
birthday,
</if>
<if
test=
"sex != null"
>
sex,
</if>
<if
test=
"idCard != null"
>
id_card,
</if>
<if
test=
"regTime != null"
>
reg_time,
</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=
"mobilePhone != null"
>
#{mobilePhone,jdbcType=VARCHAR},
</if>
<if
test=
"password != null"
>
#{password,jdbcType=VARCHAR},
</if>
<if
test=
"registerProduct != null"
>
#{registerProduct,jdbcType=INTEGER},
</if>
<if
test=
"registerSource != null"
>
#{registerSource,jdbcType=INTEGER},
</if>
<if
test=
"name != null"
>
#{name,jdbcType=VARCHAR},
</if>
<if
test=
"age != null"
>
#{age,jdbcType=TINYINT},
</if>
<if
test=
"birthday != null"
>
#{birthday,jdbcType=DATE},
</if>
<if
test=
"sex != null"
>
#{sex,jdbcType=TINYINT},
</if>
<if
test=
"idCard != null"
>
#{idCard,jdbcType=VARCHAR},
</if>
<if
test=
"regTime != null"
>
#{regTime,jdbcType=TIMESTAMP},
</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>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.pica.cloud.account.account.server.entity.AccountInfoEntity"
>
update account_info
<set>
<if
test=
"mobilePhone != null"
>
mobile_phone = #{mobilePhone,jdbcType=VARCHAR},
</if>
<if
test=
"password != null"
>
password = #{password,jdbcType=VARCHAR},
</if>
<if
test=
"registerProduct != null"
>
register_product = #{registerProduct,jdbcType=INTEGER},
</if>
<if
test=
"registerSource != null"
>
register_source = #{registerSource,jdbcType=INTEGER},
</if>
<if
test=
"name != null"
>
name = #{name,jdbcType=VARCHAR},
</if>
<if
test=
"age != null"
>
age = #{age,jdbcType=TINYINT},
</if>
<if
test=
"birthday != null"
>
birthday = #{birthday,jdbcType=DATE},
</if>
<if
test=
"sex != null"
>
sex = #{sex,jdbcType=TINYINT},
</if>
<if
test=
"idCard != null"
>
id_card = #{idCard,jdbcType=VARCHAR},
</if>
<if
test=
"regTime != null"
>
reg_time = #{regTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"deleteFlag != null"
>
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</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.AccountInfoEntity"
>
update account_info
set mobile_phone = #{mobilePhone,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
register_product = #{registerProduct,jdbcType=INTEGER},
register_source = #{registerSource,jdbcType=INTEGER},
name = #{name,jdbcType=VARCHAR},
age = #{age,jdbcType=TINYINT},
birthday = #{birthday,jdbcType=DATE},
sex = #{sex,jdbcType=TINYINT},
id_card = #{idCard,jdbcType=VARCHAR},
reg_time = #{regTime,jdbcType=TIMESTAMP},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
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>
</mapper>
\ No newline at end of file
server/src/main/resources/mybatis/AccountMapper.xml
浏览文件 @
753091e7
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
<result
column=
"sex"
jdbcType=
"INTEGER"
property=
"sex"
/>
<result
column=
"sex"
jdbcType=
"INTEGER"
property=
"sex"
/>
<result
column=
"name"
jdbcType=
"VARCHAR"
property=
"name"
/>
<result
column=
"name"
jdbcType=
"VARCHAR"
property=
"name"
/>
<result
column=
"mobile_phone"
jdbcType=
"VARCHAR"
property=
"mobilePhone"
/>
<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=
"status"
jdbcType=
"INTEGER"
property=
"status"
/>
<result
column=
"avatar_image_url"
jdbcType=
"VARCHAR"
property=
"avatarImageUrl"
/>
<result
column=
"avatar_image_url"
jdbcType=
"VARCHAR"
property=
"avatarImageUrl"
/>
<result
column=
"email"
jdbcType=
"VARCHAR"
property=
"email"
/>
<result
column=
"email"
jdbcType=
"VARCHAR"
property=
"email"
/>
...
@@ -60,6 +61,9 @@
...
@@ -60,6 +61,9 @@
<if
test=
"avatarImageUrl != null"
>
<if
test=
"avatarImageUrl != null"
>
avatar_image_url,
avatar_image_url,
</if>
</if>
<if
test=
"acctId != null"
>
acct_id,
</if>
<if
test=
"email != null"
>
<if
test=
"email != null"
>
email,
email,
</if>
</if>
...
@@ -137,6 +141,9 @@
...
@@ -137,6 +141,9 @@
<if
test=
"avatarImageUrl != null"
>
<if
test=
"avatarImageUrl != null"
>
#{avatarImageUrl,jdbcType=VARCHAR},
#{avatarImageUrl,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"acctId != null"
>
#{acctId,jdbcType=INTEGER},
</if>
<if
test=
"email != null"
>
<if
test=
"email != null"
>
#{email,jdbcType=VARCHAR},
#{email,jdbcType=VARCHAR},
</if>
</if>
...
...
server/src/main/resources/mybatis/AccountUnionEntityMapper.xml
0 → 100644
浏览文件 @
753091e7
<?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.AccountUnionMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pica.cloud.account.account.server.entity.AccountUnionEntity"
>
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<result
column=
"acct_id"
property=
"acctId"
jdbcType=
"BIGINT"
/>
<result
column=
"union_type"
property=
"unionType"
jdbcType=
"INTEGER"
/>
<result
column=
"union_id"
property=
"unionId"
jdbcType=
"VARCHAR"
/>
<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, union_type, union_id, 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_union
where id = #{id,jdbcType=INTEGER}
</select>
<!--通过unionId查询用户信息-->
<select
id=
"selectByUnionId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from account_union
where union_id = #{unionId}
</select>
<!--解除绑定关系-->
<update
id=
"updateUnbindByAcctId"
parameterType=
"java.lang.Integer"
>
update account_union
set delete_flag = 2
where acct_id = #{acctId,jdbcType=INTEGER}
</update>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer"
>
delete from account_union
where id = #{id,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
parameterType=
"com.pica.cloud.account.account.server.entity.AccountUnionEntity"
>
insert into account_union (id, acct_id, union_type,
union_id, delete_flag, created_id,
created_time, modified_id, modified_time
)
values (#{id,jdbcType=INTEGER}, #{acctId,jdbcType=BIGINT}, #{unionType,jdbcType=INTEGER},
#{unionId,jdbcType=VARCHAR}, #{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.AccountUnionEntity"
>
insert into account_union
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"acctId != null"
>
acct_id,
</if>
<if
test=
"unionType != null"
>
union_type,
</if>
<if
test=
"unionId != null"
>
union_id,
</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=BIGINT},
</if>
<if
test=
"unionType != null"
>
#{unionType,jdbcType=INTEGER},
</if>
<if
test=
"unionId != null"
>
#{unionId,jdbcType=VARCHAR},
</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>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.pica.cloud.account.account.server.entity.AccountUnionEntity"
>
update account_union
<set>
<if
test=
"acctId != null"
>
acct_id = #{acctId,jdbcType=BIGINT},
</if>
<if
test=
"unionType != null"
>
union_type = #{unionType,jdbcType=INTEGER},
</if>
<if
test=
"unionId != null"
>
union_id = #{unionId,jdbcType=VARCHAR},
</if>
<if
test=
"deleteFlag != null"
>
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</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.AccountUnionEntity"
>
update account_union
set acct_id = #{acctId,jdbcType=BIGINT},
union_type = #{unionType,jdbcType=INTEGER},
union_id = #{unionId,jdbcType=VARCHAR},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
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>
</mapper>
\ No newline at end of file
server/src/main/resources/mybatis/AccountUserInfoEntityMapper.xml
0 → 100644
浏览文件 @
753091e7
<?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.AccountPatientInfoMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pica.cloud.account.account.server.entity.AccountPatientInfoEntity"
>
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<result
column=
"acct_id"
property=
"acctId"
jdbcType=
"INTEGER"
/>
<result
column=
"village_name"
property=
"villageName"
jdbcType=
"VARCHAR"
/>
<result
column=
"village_id"
property=
"villageId"
jdbcType=
"BIGINT"
/>
<result
column=
"town_name"
property=
"townName"
jdbcType=
"VARCHAR"
/>
<result
column=
"town_id"
property=
"townId"
jdbcType=
"BIGINT"
/>
<result
column=
"county_name"
property=
"countyName"
jdbcType=
"VARCHAR"
/>
<result
column=
"county_id"
property=
"countyId"
jdbcType=
"BIGINT"
/>
<result
column=
"city_name"
property=
"cityName"
jdbcType=
"VARCHAR"
/>
<result
column=
"city_id"
property=
"cityId"
jdbcType=
"BIGINT"
/>
<result
column=
"province_name"
property=
"provinceName"
jdbcType=
"VARCHAR"
/>
<result
column=
"province_id"
property=
"provinceId"
jdbcType=
"BIGINT"
/>
<result
column=
"country"
property=
"country"
jdbcType=
"BIGINT"
/>
<result
column=
"head_img_url"
property=
"headImgUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"address"
property=
"address"
jdbcType=
"VARCHAR"
/>
<result
column=
"patient_address"
property=
"patientAddress"
jdbcType=
"VARCHAR"
/>
<result
column=
"telephone"
property=
"telephone"
jdbcType=
"VARCHAR"
/>
<result
column=
"social_card"
property=
"socialCard"
jdbcType=
"VARCHAR"
/>
<result
column=
"work_unit"
property=
"workUnit"
jdbcType=
"VARCHAR"
/>
<result
column=
"health_file_number"
property=
"healthFileNumber"
jdbcType=
"VARCHAR"
/>
<result
column=
"payment_type"
property=
"paymentType"
jdbcType=
"VARCHAR"
/>
<result
column=
"remarks"
property=
"remarks"
jdbcType=
"VARCHAR"
/>
<result
column=
"email"
property=
"email"
jdbcType=
"VARCHAR"
/>
<result
column=
"nation"
property=
"nation"
jdbcType=
"VARCHAR"
/>
<result
column=
"create_id"
property=
"createId"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"modify_id"
property=
"modifyId"
jdbcType=
"INTEGER"
/>
<result
column=
"modify_time"
property=
"modifyTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"delete_flag"
property=
"deleteFlag"
jdbcType=
"TINYINT"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, acct_id, village_name, village_id, town_name, town_id, county_name, county_id,
city_name, city_id, province_name, province_id, country, head_img_url, address, patient_address,
telephone, social_card, work_unit, health_file_number, payment_type, remarks, email,
nation, create_id, create_time, modify_id, modify_time, delete_flag
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Integer"
>
select
<include
refid=
"Base_Column_List"
/>
from p_patient
where id = #{id,jdbcType=INTEGER}
</select>
<!--通过用户id查询信息-->
<select
id=
"selectByUserId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Integer"
>
select
<include
refid=
"Base_Column_List"
/>
from p_patient
where id = #{id,jdbcType=INTEGER}
</select>
<!--通过账户id查询信息-->
<select
id=
"selectByAcctId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Integer"
>
select
<include
refid=
"Base_Column_List"
/>
from p_patient
where acct_id = #{AcctId,jdbcType=INTEGER}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer"
>
delete from p_patient
where id = #{id,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
parameterType=
"com.pica.cloud.account.account.server.entity.AccountPatientInfoEntity"
>
insert into p_patient (id, acct_id, village_name,
village_id, town_name, town_id,
county_name, county_id, city_name,
city_id, province_name, province_id,
country, head_img_url, address,
patient_address, telephone, social_card,
work_unit, health_file_number, payment_type,
remarks, email, nation,
create_id, create_time, modify_id,
modify_time, delete_flag)
values (#{id,jdbcType=INTEGER}, #{acctId,jdbcType=INTEGER}, #{villageName,jdbcType=VARCHAR},
#{villageId,jdbcType=BIGINT}, #{townName,jdbcType=VARCHAR}, #{townId,jdbcType=BIGINT},
#{countyName,jdbcType=VARCHAR}, #{countyId,jdbcType=BIGINT}, #{cityName,jdbcType=VARCHAR},
#{cityId,jdbcType=BIGINT}, #{provinceName,jdbcType=VARCHAR}, #{provinceId,jdbcType=BIGINT},
#{country,jdbcType=BIGINT}, #{headImgUrl,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
#{patientAddress,jdbcType=VARCHAR}, #{telephone,jdbcType=VARCHAR}, #{socialCard,jdbcType=VARCHAR},
#{workUnit,jdbcType=VARCHAR}, #{healthFileNumber,jdbcType=VARCHAR}, #{paymentType,jdbcType=VARCHAR},
#{remarks,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{nation,jdbcType=VARCHAR},
#{createId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{modifyId,jdbcType=INTEGER},
#{modifyTime,jdbcType=TIMESTAMP}, #{deleteFlag,jdbcType=TINYINT})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.pica.cloud.account.account.server.entity.AccountPatientInfoEntity"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into p_patient
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"acctId != null"
>
acct_id,
</if>
<if
test=
"villageName != null"
>
village_name,
</if>
<if
test=
"villageId != null"
>
village_id,
</if>
<if
test=
"townName != null"
>
town_name,
</if>
<if
test=
"townId != null"
>
town_id,
</if>
<if
test=
"countyName != null"
>
county_name,
</if>
<if
test=
"countyId != null"
>
county_id,
</if>
<if
test=
"cityName != null"
>
city_name,
</if>
<if
test=
"cityId != null"
>
city_id,
</if>
<if
test=
"provinceName != null"
>
province_name,
</if>
<if
test=
"provinceId != null"
>
province_id,
</if>
<if
test=
"country != null"
>
country,
</if>
<if
test=
"headImgUrl != null"
>
head_img_url,
</if>
<if
test=
"address != null"
>
address,
</if>
<if
test=
"patientAddress != null"
>
patient_address,
</if>
<if
test=
"telephone != null"
>
telephone,
</if>
<if
test=
"socialCard != null"
>
social_card,
</if>
<if
test=
"workUnit != null"
>
work_unit,
</if>
<if
test=
"healthFileNumber != null"
>
health_file_number,
</if>
<if
test=
"paymentType != null"
>
payment_type,
</if>
<if
test=
"remarks != null"
>
remarks,
</if>
<if
test=
"email != null"
>
email,
</if>
<if
test=
"nation != null"
>
nation,
</if>
<if
test=
"createId != null"
>
create_id,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"modifyId != null"
>
modify_id,
</if>
<if
test=
"modifyTime != null"
>
modify_time,
</if>
<if
test=
"deleteFlag != null"
>
delete_flag,
</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=
"villageName != null"
>
#{villageName,jdbcType=VARCHAR},
</if>
<if
test=
"villageId != null"
>
#{villageId,jdbcType=BIGINT},
</if>
<if
test=
"townName != null"
>
#{townName,jdbcType=VARCHAR},
</if>
<if
test=
"townId != null"
>
#{townId,jdbcType=BIGINT},
</if>
<if
test=
"countyName != null"
>
#{countyName,jdbcType=VARCHAR},
</if>
<if
test=
"countyId != null"
>
#{countyId,jdbcType=BIGINT},
</if>
<if
test=
"cityName != null"
>
#{cityName,jdbcType=VARCHAR},
</if>
<if
test=
"cityId != null"
>
#{cityId,jdbcType=BIGINT},
</if>
<if
test=
"provinceName != null"
>
#{provinceName,jdbcType=VARCHAR},
</if>
<if
test=
"provinceId != null"
>
#{provinceId,jdbcType=BIGINT},
</if>
<if
test=
"country != null"
>
#{country,jdbcType=BIGINT},
</if>
<if
test=
"headImgUrl != null"
>
#{headImgUrl,jdbcType=VARCHAR},
</if>
<if
test=
"address != null"
>
#{address,jdbcType=VARCHAR},
</if>
<if
test=
"patientAddress != null"
>
#{patientAddress,jdbcType=VARCHAR},
</if>
<if
test=
"telephone != null"
>
#{telephone,jdbcType=VARCHAR},
</if>
<if
test=
"socialCard != null"
>
#{socialCard,jdbcType=VARCHAR},
</if>
<if
test=
"workUnit != null"
>
#{workUnit,jdbcType=VARCHAR},
</if>
<if
test=
"healthFileNumber != null"
>
#{healthFileNumber,jdbcType=VARCHAR},
</if>
<if
test=
"paymentType != null"
>
#{paymentType,jdbcType=VARCHAR},
</if>
<if
test=
"remarks != null"
>
#{remarks,jdbcType=VARCHAR},
</if>
<if
test=
"email != null"
>
#{email,jdbcType=VARCHAR},
</if>
<if
test=
"nation != null"
>
#{nation,jdbcType=VARCHAR},
</if>
<if
test=
"createId != null"
>
#{createId,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"modifyId != null"
>
#{modifyId,jdbcType=INTEGER},
</if>
<if
test=
"modifyTime != null"
>
#{modifyTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"deleteFlag != null"
>
#{deleteFlag,jdbcType=TINYINT},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.pica.cloud.account.account.server.entity.AccountPatientInfoEntity"
>
update p_patient
<set>
<if
test=
"acctId != null"
>
acct_id = #{acctId,jdbcType=INTEGER},
</if>
<if
test=
"villageName != null"
>
village_name = #{villageName,jdbcType=VARCHAR},
</if>
<if
test=
"villageId != null"
>
village_id = #{villageId,jdbcType=BIGINT},
</if>
<if
test=
"townName != null"
>
town_name = #{townName,jdbcType=VARCHAR},
</if>
<if
test=
"townId != null"
>
town_id = #{townId,jdbcType=BIGINT},
</if>
<if
test=
"countyName != null"
>
county_name = #{countyName,jdbcType=VARCHAR},
</if>
<if
test=
"countyId != null"
>
county_id = #{countyId,jdbcType=BIGINT},
</if>
<if
test=
"cityName != null"
>
city_name = #{cityName,jdbcType=VARCHAR},
</if>
<if
test=
"cityId != null"
>
city_id = #{cityId,jdbcType=BIGINT},
</if>
<if
test=
"provinceName != null"
>
province_name = #{provinceName,jdbcType=VARCHAR},
</if>
<if
test=
"provinceId != null"
>
province_id = #{provinceId,jdbcType=BIGINT},
</if>
<if
test=
"country != null"
>
country = #{country,jdbcType=BIGINT},
</if>
<if
test=
"headImgUrl != null"
>
head_img_url = #{headImgUrl,jdbcType=VARCHAR},
</if>
<if
test=
"address != null"
>
address = #{address,jdbcType=VARCHAR},
</if>
<if
test=
"patientAddress != null"
>
patient_address = #{patientAddress,jdbcType=VARCHAR},
</if>
<if
test=
"telephone != null"
>
telephone = #{telephone,jdbcType=VARCHAR},
</if>
<if
test=
"socialCard != null"
>
social_card = #{socialCard,jdbcType=VARCHAR},
</if>
<if
test=
"workUnit != null"
>
work_unit = #{workUnit,jdbcType=VARCHAR},
</if>
<if
test=
"healthFileNumber != null"
>
health_file_number = #{healthFileNumber,jdbcType=VARCHAR},
</if>
<if
test=
"paymentType != null"
>
payment_type = #{paymentType,jdbcType=VARCHAR},
</if>
<if
test=
"remarks != null"
>
remarks = #{remarks,jdbcType=VARCHAR},
</if>
<if
test=
"email != null"
>
email = #{email,jdbcType=VARCHAR},
</if>
<if
test=
"nation != null"
>
nation = #{nation,jdbcType=VARCHAR},
</if>
<if
test=
"createId != null"
>
create_id = #{createId,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"modifyId != null"
>
modify_id = #{modifyId,jdbcType=INTEGER},
</if>
<if
test=
"modifyTime != null"
>
modify_time = #{modifyTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"deleteFlag != null"
>
delete_flag = #{deleteFlag,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.pica.cloud.account.account.server.entity.AccountPatientInfoEntity"
>
update p_patient
set acct_id = #{acctId,jdbcType=INTEGER},
village_name = #{villageName,jdbcType=VARCHAR},
village_id = #{villageId,jdbcType=BIGINT},
town_name = #{townName,jdbcType=VARCHAR},
town_id = #{townId,jdbcType=BIGINT},
county_name = #{countyName,jdbcType=VARCHAR},
county_id = #{countyId,jdbcType=BIGINT},
city_name = #{cityName,jdbcType=VARCHAR},
city_id = #{cityId,jdbcType=BIGINT},
province_name = #{provinceName,jdbcType=VARCHAR},
province_id = #{provinceId,jdbcType=BIGINT},
country = #{country,jdbcType=BIGINT},
head_img_url = #{headImgUrl,jdbcType=VARCHAR},
address = #{address,jdbcType=VARCHAR},
patient_address = #{patientAddress,jdbcType=VARCHAR},
telephone = #{telephone,jdbcType=VARCHAR},
social_card = #{socialCard,jdbcType=VARCHAR},
work_unit = #{workUnit,jdbcType=VARCHAR},
health_file_number = #{healthFileNumber,jdbcType=VARCHAR},
payment_type = #{paymentType,jdbcType=VARCHAR},
remarks = #{remarks,jdbcType=VARCHAR},
email = #{email,jdbcType=VARCHAR},
nation = #{nation,jdbcType=VARCHAR},
create_id = #{createId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
modify_id = #{modifyId,jdbcType=INTEGER},
modify_time = #{modifyTime,jdbcType=TIMESTAMP},
delete_flag = #{deleteFlag,jdbcType=TINYINT}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
server/src/main/resources/mybatis/AccountWeChatInfoEntityMapper.xml
0 → 100644
浏览文件 @
753091e7
<?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.AccountWeChatInfoMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pica.cloud.account.account.server.entity.AccountWeChatInfoEntity"
>
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<result
column=
"unionid"
property=
"unionid"
jdbcType=
"VARCHAR"
/>
<result
column=
"openid"
property=
"openid"
jdbcType=
"VARCHAR"
/>
<result
column=
"nickname"
property=
"nickname"
jdbcType=
"VARCHAR"
/>
<result
column=
"head_img_url"
property=
"headImgUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"sex"
property=
"sex"
jdbcType=
"TINYINT"
/>
<result
column=
"country"
property=
"country"
jdbcType=
"VARCHAR"
/>
<result
column=
"province"
property=
"province"
jdbcType=
"VARCHAR"
/>
<result
column=
"city"
property=
"city"
jdbcType=
"VARCHAR"
/>
<result
column=
"language"
property=
"language"
jdbcType=
"VARCHAR"
/>
<result
column=
"type"
property=
"type"
jdbcType=
"INTEGER"
/>
<result
column=
"privilege"
property=
"privilege"
jdbcType=
"VARCHAR"
/>
<result
column=
"subscribe"
property=
"subscribe"
jdbcType=
"INTEGER"
/>
<result
column=
"subscribe_time"
property=
"subscribeTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"remark"
property=
"remark"
jdbcType=
"VARCHAR"
/>
<result
column=
"groupid"
property=
"groupid"
jdbcType=
"VARCHAR"
/>
<result
column=
"tagid_list"
property=
"tagidList"
jdbcType=
"VARCHAR"
/>
<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, unionid, openid, nickname, head_img_url, sex, country, province, city, language,
type, privilege, subscribe, subscribe_time, remark, groupid, tagid_list, 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_wechat_info
where id = #{id,jdbcType=INTEGER}
</select>
<!--通过UnionId获取微信信息-->
<select
id=
"selectByUnionId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Integer"
>
select
<include
refid=
"Base_Column_List"
/>
from account_wechat_info
where unionid = #{id}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer"
>
delete from account_wechat_info
where id = #{id,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
parameterType=
"com.pica.cloud.account.account.server.entity.AccountWeChatInfoEntity"
>
insert into account_wechat_info (id, unionid, openid,
nickname, head_img_url, sex,
country, province, city,
language, type, privilege,
subscribe, subscribe_time, remark,
groupid, tagid_list, delete_flag,
created_id, created_time, modified_id,
modified_time)
values (#{id,jdbcType=INTEGER}, #{unionid,jdbcType=VARCHAR}, #{openid,jdbcType=VARCHAR},
#{nickname,jdbcType=VARCHAR}, #{headImgUrl,jdbcType=VARCHAR}, #{sex,jdbcType=TINYINT},
#{country,jdbcType=VARCHAR}, #{province,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR},
#{language,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{privilege,jdbcType=VARCHAR},
#{subscribe,jdbcType=INTEGER}, #{subscribeTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR},
#{groupid,jdbcType=VARCHAR}, #{tagidList,jdbcType=VARCHAR}, #{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.AccountWeChatInfoEntity"
>
insert into account_wechat_info
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"unionid != null"
>
unionid,
</if>
<if
test=
"openid != null"
>
openid,
</if>
<if
test=
"nickname != null"
>
nickname,
</if>
<if
test=
"headImgUrl != null"
>
head_img_url,
</if>
<if
test=
"sex != null"
>
sex,
</if>
<if
test=
"country != null"
>
country,
</if>
<if
test=
"province != null"
>
province,
</if>
<if
test=
"city != null"
>
city,
</if>
<if
test=
"language != null"
>
language,
</if>
<if
test=
"type != null"
>
type,
</if>
<if
test=
"privilege != null"
>
privilege,
</if>
<if
test=
"subscribe != null"
>
subscribe,
</if>
<if
test=
"subscribeTime != null"
>
subscribe_time,
</if>
<if
test=
"remark != null"
>
remark,
</if>
<if
test=
"groupid != null"
>
groupid,
</if>
<if
test=
"tagidList != null"
>
tagid_list,
</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=
"unionid != null"
>
#{unionid,jdbcType=VARCHAR},
</if>
<if
test=
"openid != null"
>
#{openid,jdbcType=VARCHAR},
</if>
<if
test=
"nickname != null"
>
#{nickname,jdbcType=VARCHAR},
</if>
<if
test=
"headImgUrl != null"
>
#{headImgUrl,jdbcType=VARCHAR},
</if>
<if
test=
"sex != null"
>
#{sex,jdbcType=TINYINT},
</if>
<if
test=
"country != null"
>
#{country,jdbcType=VARCHAR},
</if>
<if
test=
"province != null"
>
#{province,jdbcType=VARCHAR},
</if>
<if
test=
"city != null"
>
#{city,jdbcType=VARCHAR},
</if>
<if
test=
"language != null"
>
#{language,jdbcType=VARCHAR},
</if>
<if
test=
"type != null"
>
#{type,jdbcType=INTEGER},
</if>
<if
test=
"privilege != null"
>
#{privilege,jdbcType=VARCHAR},
</if>
<if
test=
"subscribe != null"
>
#{subscribe,jdbcType=INTEGER},
</if>
<if
test=
"subscribeTime != null"
>
#{subscribeTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"remark != null"
>
#{remark,jdbcType=VARCHAR},
</if>
<if
test=
"groupid != null"
>
#{groupid,jdbcType=VARCHAR},
</if>
<if
test=
"tagidList != null"
>
#{tagidList,jdbcType=VARCHAR},
</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>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.pica.cloud.account.account.server.entity.AccountWeChatInfoEntity"
>
update account_wechat_info
<set
>
<if
test=
"unionid != null"
>
unionid = #{unionid,jdbcType=VARCHAR},
</if>
<if
test=
"openid != null"
>
openid = #{openid,jdbcType=VARCHAR},
</if>
<if
test=
"nickname != null"
>
nickname = #{nickname,jdbcType=VARCHAR},
</if>
<if
test=
"headImgUrl != null"
>
head_img_url = #{headImgUrl,jdbcType=VARCHAR},
</if>
<if
test=
"sex != null"
>
sex = #{sex,jdbcType=TINYINT},
</if>
<if
test=
"country != null"
>
country = #{country,jdbcType=VARCHAR},
</if>
<if
test=
"province != null"
>
province = #{province,jdbcType=VARCHAR},
</if>
<if
test=
"city != null"
>
city = #{city,jdbcType=VARCHAR},
</if>
<if
test=
"language != null"
>
language = #{language,jdbcType=VARCHAR},
</if>
<if
test=
"type != null"
>
type = #{type,jdbcType=INTEGER},
</if>
<if
test=
"privilege != null"
>
privilege = #{privilege,jdbcType=VARCHAR},
</if>
<if
test=
"subscribe != null"
>
subscribe = #{subscribe,jdbcType=INTEGER},
</if>
<if
test=
"subscribeTime != null"
>
subscribe_time = #{subscribeTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"remark != null"
>
remark = #{remark,jdbcType=VARCHAR},
</if>
<if
test=
"groupid != null"
>
groupid = #{groupid,jdbcType=VARCHAR},
</if>
<if
test=
"tagidList != null"
>
tagid_list = #{tagidList,jdbcType=VARCHAR},
</if>
<if
test=
"deleteFlag != null"
>
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</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.AccountWeChatInfoEntity"
>
update account_wechat_info
set unionid = #{unionid,jdbcType=VARCHAR},
openid = #{openid,jdbcType=VARCHAR},
nickname = #{nickname,jdbcType=VARCHAR},
head_img_url = #{headImgUrl,jdbcType=VARCHAR},
sex = #{sex,jdbcType=TINYINT},
country = #{country,jdbcType=VARCHAR},
province = #{province,jdbcType=VARCHAR},
city = #{city,jdbcType=VARCHAR},
language = #{language,jdbcType=VARCHAR},
type = #{type,jdbcType=INTEGER},
privilege = #{privilege,jdbcType=VARCHAR},
subscribe = #{subscribe,jdbcType=INTEGER},
subscribe_time = #{subscribeTime,jdbcType=TIMESTAMP},
remark = #{remark,jdbcType=VARCHAR},
groupid = #{groupid,jdbcType=VARCHAR},
tagid_list = #{tagidList,jdbcType=VARCHAR},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
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>
</mapper>
\ No newline at end of file
server/src/main/resources/mybatis/AgreementEntityMapper.xml
0 → 100644
浏览文件 @
753091e7
<?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.AgreementEntityMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pica.cloud.account.account.server.entity.AgreementEntity"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"agreement_type"
property=
"agreement_type"
jdbcType=
"INTEGER"
/>
<result
column=
"version"
property=
"version"
jdbcType=
"VARCHAR"
/>
<result
column=
"delete_flag"
property=
"delete_flag"
jdbcType=
"INTEGER"
/>
<result
column=
"created_id"
property=
"created_id"
jdbcType=
"BIGINT"
/>
<result
column=
"created_time"
property=
"created_time"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"modified_id"
property=
"modified_id"
jdbcType=
"BIGINT"
/>
<result
column=
"modified_time"
property=
"modified_time"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<resultMap
id=
"ResultMapWithBLOBs"
type=
"com.pica.cloud.account.account.server.entity.AgreementEntity"
extends=
"BaseResultMap"
>
<result
column=
"agreement_content"
property=
"agreement_content"
jdbcType=
"LONGVARCHAR"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, agreement_type, version, delete_flag, created_id, created_time, modified_id,
modified_time
</sql>
<sql
id=
"Blob_Column_List"
>
agreement_content
</sql>
<!--通过类型获取用户同意的协议的版本-->
<select
id=
"selectByType"
parameterType=
"Integer"
resultType=
"Integer"
>
select version from doctor_agreement
where agreement_type = #{agreementType}
</select>
<select
id=
"selectByPrimaryKey"
resultMap=
"ResultMapWithBLOBs"
parameterType=
"java.lang.Long"
>
select
<include
refid=
"Base_Column_List"
/>
,
<include
refid=
"Blob_Column_List"
/>
from doctor_agreement
where id = #{id,jdbcType=BIGINT}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from doctor_agreement
where id = #{id,jdbcType=BIGINT}
</delete>
<insert
id=
"insert"
parameterType=
"com.pica.cloud.account.account.server.entity.AgreementEntity"
>
insert into doctor_agreement (id, agreement_type, version,
delete_flag, created_id, created_time,
modified_id, modified_time, agreement_content
)
values (#{id,jdbcType=BIGINT}, #{agreement_type,jdbcType=INTEGER}, #{version,jdbcType=VARCHAR},
#{delete_flag,jdbcType=INTEGER}, #{created_id,jdbcType=BIGINT}, #{created_time,jdbcType=TIMESTAMP},
#{modified_id,jdbcType=BIGINT}, #{modified_time,jdbcType=TIMESTAMP}, #{agreement_content,jdbcType=LONGVARCHAR}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.pica.cloud.account.account.server.entity.AgreementEntity"
>
insert into doctor_agreement
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"agreement_type != null"
>
agreement_type,
</if>
<if
test=
"version != null"
>
version,
</if>
<if
test=
"delete_flag != null"
>
delete_flag,
</if>
<if
test=
"created_id != null"
>
created_id,
</if>
<if
test=
"created_time != null"
>
created_time,
</if>
<if
test=
"modified_id != null"
>
modified_id,
</if>
<if
test=
"modified_time != null"
>
modified_time,
</if>
<if
test=
"agreement_content != null"
>
agreement_content,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id,jdbcType=BIGINT},
</if>
<if
test=
"agreement_type != null"
>
#{agreement_type,jdbcType=INTEGER},
</if>
<if
test=
"version != null"
>
#{version,jdbcType=VARCHAR},
</if>
<if
test=
"delete_flag != null"
>
#{delete_flag,jdbcType=INTEGER},
</if>
<if
test=
"created_id != null"
>
#{created_id,jdbcType=BIGINT},
</if>
<if
test=
"created_time != null"
>
#{created_time,jdbcType=TIMESTAMP},
</if>
<if
test=
"modified_id != null"
>
#{modified_id,jdbcType=BIGINT},
</if>
<if
test=
"modified_time != null"
>
#{modified_time,jdbcType=TIMESTAMP},
</if>
<if
test=
"agreement_content != null"
>
#{agreement_content,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.pica.cloud.account.account.server.entity.AgreementEntity"
>
update doctor_agreement
<set>
<if
test=
"agreement_type != null"
>
agreement_type = #{agreement_type,jdbcType=INTEGER},
</if>
<if
test=
"version != null"
>
version = #{version,jdbcType=VARCHAR},
</if>
<if
test=
"delete_flag != null"
>
delete_flag = #{delete_flag,jdbcType=INTEGER},
</if>
<if
test=
"created_id != null"
>
created_id = #{created_id,jdbcType=BIGINT},
</if>
<if
test=
"created_time != null"
>
created_time = #{created_time,jdbcType=TIMESTAMP},
</if>
<if
test=
"modified_id != null"
>
modified_id = #{modified_id,jdbcType=BIGINT},
</if>
<if
test=
"modified_time != null"
>
modified_time = #{modified_time,jdbcType=TIMESTAMP},
</if>
<if
test=
"agreement_content != null"
>
agreement_content = #{agreement_content,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update
id=
"updateByPrimaryKeyWithBLOBs"
parameterType=
"com.pica.cloud.account.account.server.entity.AgreementEntity"
>
update doctor_agreement
set agreement_type = #{agreement_type,jdbcType=INTEGER},
version = #{version,jdbcType=VARCHAR},
delete_flag = #{delete_flag,jdbcType=INTEGER},
created_id = #{created_id,jdbcType=BIGINT},
created_time = #{created_time,jdbcType=TIMESTAMP},
modified_id = #{modified_id,jdbcType=BIGINT},
modified_time = #{modified_time,jdbcType=TIMESTAMP},
agreement_content = #{agreement_content,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.pica.cloud.account.account.server.entity.AgreementEntity"
>
update doctor_agreement
set agreement_type = #{agreement_type,jdbcType=INTEGER},
version = #{version,jdbcType=VARCHAR},
delete_flag = #{delete_flag,jdbcType=INTEGER},
created_id = #{created_id,jdbcType=BIGINT},
created_time = #{created_time,jdbcType=TIMESTAMP},
modified_id = #{modified_id,jdbcType=BIGINT},
modified_time = #{modified_time,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
server/src/main/resources/mybatis/AgreementLogEntityMapper.xml
0 → 100644
浏览文件 @
753091e7
<?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.AgreementLogEntityMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pica.cloud.account.account.server.entity.AgreementLogEntity"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"doctor_id"
property=
"doctor_id"
jdbcType=
"BIGINT"
/>
<result
column=
"agreement_type"
property=
"agreement_type"
jdbcType=
"INTEGER"
/>
<result
column=
"version"
property=
"version"
jdbcType=
"VARCHAR"
/>
<result
column=
"delete_flag"
property=
"delete_flag"
jdbcType=
"INTEGER"
/>
<result
column=
"created_id"
property=
"created_id"
jdbcType=
"BIGINT"
/>
<result
column=
"created_time"
property=
"created_time"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"modified_id"
property=
"modified_id"
jdbcType=
"BIGINT"
/>
<result
column=
"modified_time"
property=
"modified_time"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, doctor_id, agreement_type, version, delete_flag, created_id, created_time, modified_id,
modified_time
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
select
<include
refid=
"Base_Column_List"
/>
from doctor_agreement_log
where id = #{id,jdbcType=BIGINT}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from doctor_agreement_log
where id = #{id,jdbcType=BIGINT}
</delete>
<insert
id=
"insert"
parameterType=
"com.pica.cloud.account.account.server.entity.AgreementLogEntity"
>
insert into doctor_agreement_log (id, doctor_id, agreement_type,
version, delete_flag, created_id,
created_time, modified_id, modified_time)
values (#{id,jdbcType=BIGINT}, #{doctor_id,jdbcType=BIGINT}, #{agreement_type,jdbcType=INTEGER},
#{version,jdbcType=VARCHAR}, #{delete_flag,jdbcType=INTEGER}, #{created_id,jdbcType=BIGINT},
#{created_time,jdbcType=TIMESTAMP}, #{modified_id,jdbcType=BIGINT}, #{modified_time,jdbcType=TIMESTAMP}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.pica.cloud.account.account.server.entity.AgreementLogEntity"
>
insert into doctor_agreement_log
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"doctor_id != null"
>
doctor_id,
</if>
<if
test=
"agreement_type != null"
>
agreement_type,
</if>
<if
test=
"version != null"
>
version,
</if>
<if
test=
"delete_flag != null"
>
delete_flag,
</if>
<if
test=
"created_id != null"
>
created_id,
</if>
<if
test=
"created_time != null"
>
created_time,
</if>
<if
test=
"modified_id != null"
>
modified_id,
</if>
<if
test=
"modified_time != null"
>
modified_time,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id,jdbcType=BIGINT},
</if>
<if
test=
"doctor_id != null"
>
#{doctor_id,jdbcType=BIGINT},
</if>
<if
test=
"agreement_type != null"
>
#{agreement_type,jdbcType=INTEGER},
</if>
<if
test=
"version != null"
>
#{version,jdbcType=VARCHAR},
</if>
<if
test=
"delete_flag != null"
>
#{delete_flag,jdbcType=INTEGER},
</if>
<if
test=
"created_id != null"
>
#{created_id,jdbcType=BIGINT},
</if>
<if
test=
"created_time != null"
>
#{created_time,jdbcType=TIMESTAMP},
</if>
<if
test=
"modified_id != null"
>
#{modified_id,jdbcType=BIGINT},
</if>
<if
test=
"modified_time != null"
>
#{modified_time,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.pica.cloud.account.account.server.entity.AgreementLogEntity"
>
update doctor_agreement_log
<set
>
<if
test=
"doctor_id != null"
>
doctor_id = #{doctor_id,jdbcType=BIGINT},
</if>
<if
test=
"agreement_type != null"
>
agreement_type = #{agreement_type,jdbcType=INTEGER},
</if>
<if
test=
"version != null"
>
version = #{version,jdbcType=VARCHAR},
</if>
<if
test=
"delete_flag != null"
>
delete_flag = #{delete_flag,jdbcType=INTEGER},
</if>
<if
test=
"created_id != null"
>
created_id = #{created_id,jdbcType=BIGINT},
</if>
<if
test=
"created_time != null"
>
created_time = #{created_time,jdbcType=TIMESTAMP},
</if>
<if
test=
"modified_id != null"
>
modified_id = #{modified_id,jdbcType=BIGINT},
</if>
<if
test=
"modified_time != null"
>
modified_time = #{modified_time,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.pica.cloud.account.account.server.entity.AgreementLogEntity"
>
update doctor_agreement_log
set doctor_id = #{doctor_id,jdbcType=BIGINT},
agreement_type = #{agreement_type,jdbcType=INTEGER},
version = #{version,jdbcType=VARCHAR},
delete_flag = #{delete_flag,jdbcType=INTEGER},
created_id = #{created_id,jdbcType=BIGINT},
created_time = #{created_time,jdbcType=TIMESTAMP},
modified_id = #{modified_id,jdbcType=BIGINT},
modified_time = #{modified_time,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
server/src/main/resources/mybatis/DoctorMapper.xml
0 → 100644
浏览文件 @
753091e7
<?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.DoctorMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pica.cloud.account.account.server.entity.Doctor"
>
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<result
column=
"sex"
property=
"sex"
jdbcType=
"INTEGER"
/>
<result
column=
"name"
property=
"name"
jdbcType=
"VARCHAR"
/>
<result
column=
"mobile_phone"
property=
"mobilePhone"
jdbcType=
"VARCHAR"
/>
<result
column=
"tel"
property=
"tel"
jdbcType=
"VARCHAR"
/>
<result
column=
"status"
property=
"status"
jdbcType=
"INTEGER"
/>
<result
column=
"type"
property=
"type"
jdbcType=
"INTEGER"
/>
<result
column=
"hospital_id"
property=
"hospitalId"
jdbcType=
"INTEGER"
/>
<result
column=
"department_id"
property=
"departmentId"
jdbcType=
"INTEGER"
/>
<result
column=
"title_id"
property=
"titleId"
jdbcType=
"INTEGER"
/>
<result
column=
"hospital"
property=
"hospital"
jdbcType=
"VARCHAR"
/>
<result
column=
"department"
property=
"department"
jdbcType=
"VARCHAR"
/>
<result
column=
"title"
property=
"title"
jdbcType=
"VARCHAR"
/>
<result
column=
"cert_image_url"
property=
"certImageUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"avatar_image_url"
property=
"avatarImageUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"auth_time"
property=
"authTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"honor"
property=
"honor"
jdbcType=
"VARCHAR"
/>
<result
column=
"skills"
property=
"skills"
jdbcType=
"VARCHAR"
/>
<result
column=
"thumb_up_num"
property=
"thumbUpNum"
jdbcType=
"INTEGER"
/>
<result
column=
"email"
property=
"email"
jdbcType=
"VARCHAR"
/>
<result
column=
"qrcode"
property=
"qrcode"
jdbcType=
"VARCHAR"
/>
<result
column=
"nickname"
property=
"nickname"
jdbcType=
"VARCHAR"
/>
<result
column=
"personal_sign"
property=
"personalSign"
jdbcType=
"VARCHAR"
/>
<result
column=
"delete_flag"
property=
"deleteFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"creat_id"
property=
"creatId"
jdbcType=
"INTEGER"
/>
<result
column=
"creat_time"
property=
"creatTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"modify_id"
property=
"modifyId"
jdbcType=
"INTEGER"
/>
<result
column=
"modify_time"
property=
"modifyTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"praise_num"
property=
"praiseNum"
jdbcType=
"INTEGER"
/>
<result
column=
"password"
property=
"password"
jdbcType=
"VARCHAR"
/>
<result
column=
"info"
property=
"info"
jdbcType=
"VARCHAR"
/>
<result
column=
"rank"
property=
"rank"
jdbcType=
"VARCHAR"
/>
<result
column=
"province"
property=
"province"
jdbcType=
"BIGINT"
/>
<result
column=
"province_name"
property=
"provinceName"
jdbcType=
"VARCHAR"
/>
<result
column=
"city"
property=
"city"
jdbcType=
"BIGINT"
/>
<result
column=
"city_name"
property=
"cityName"
jdbcType=
"VARCHAR"
/>
<result
column=
"county"
property=
"county"
jdbcType=
"BIGINT"
/>
<result
column=
"county_name"
property=
"countyName"
jdbcType=
"VARCHAR"
/>
<result
column=
"town"
property=
"town"
jdbcType=
"BIGINT"
/>
<result
column=
"town_name"
property=
"townName"
jdbcType=
"VARCHAR"
/>
<result
column=
"invite_code"
property=
"inviteCode"
jdbcType=
"VARCHAR"
/>
<result
column=
"invite_start_time"
property=
"inviteStartTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"gaoxueya_password"
property=
"gaoxueyaPassword"
jdbcType=
"VARCHAR"
/>
<result
column=
"sms_send_num"
property=
"smsSendNum"
jdbcType=
"INTEGER"
/>
<result
column=
"total_sms_send_num"
property=
"totalSmsSendNum"
jdbcType=
"INTEGER"
/>
<result
column=
"entire_flag"
property=
"entireFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"doctor_project_type"
property=
"doctorProjectType"
jdbcType=
"INTEGER"
/>
<result
column=
"reg_time"
property=
"regTime"
jdbcType=
"DATE"
/>
<result
column=
"last_login_time"
property=
"lastLoginTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"unionid"
property=
"unionid"
jdbcType=
"VARCHAR"
/>
<result
column=
"register_source"
property=
"registerSource"
jdbcType=
"INTEGER"
/>
<result
column=
"comment"
property=
"comment"
jdbcType=
"VARCHAR"
/>
<result
column=
"administer_title_id"
property=
"administerTitleId"
jdbcType=
"INTEGER"
/>
<result
column=
"administer_title"
property=
"administerTitle"
jdbcType=
"VARCHAR"
/>
<result
column=
"register_type"
property=
"registerType"
jdbcType=
"INTEGER"
/>
<result
column=
"first_login_time"
property=
"firstLoginTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"card"
property=
"card"
jdbcType=
"VARCHAR"
/>
<result
column=
"birthday"
property=
"birthday"
jdbcType=
"DATE"
/>
<result
column=
"show_flag"
property=
"showFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"acct_id"
property=
"acctId"
jdbcType=
"INTEGER"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, sex, name, mobile_phone, tel, status, type, hospital_id, department_id, title_id,
hospital, department, title, cert_image_url, avatar_image_url, auth_time, honor,
skills, thumb_up_num, email, qrcode, nickname, personal_sign, delete_flag, creat_id,
creat_time, modify_id, modify_time, praise_num, password, info, rank, province, province_name,
city, city_name, county, county_name, town, town_name, invite_code, invite_start_time,
gaoxueya_password, sms_send_num, total_sms_send_num, entire_flag, doctor_project_type,
reg_time, last_login_time, unionid, register_source, comment, administer_title_id,
administer_title, register_type, first_login_time, card, birthday, show_flag, acct_id
</sql>
<!--通过账户id查询用户信息-->
<select
id=
"selectUserIdByAcctId"
parameterType=
"java.lang.Integer"
resultType=
"java.lang.Long"
>
SELECT id
FROM p_doctor
where acct_id = #{acctId}
and delete_flag = 1
</select>
<!--通过手机号查询用户id-->
<select
id=
"selectDoctorIdByMobile"
parameterType=
"java.lang.String"
resultType=
"java.lang.Long"
>
SELECT id
FROM p_doctor
where mobile_phone = #{mobile}
and delete_flag = 1
</select>
<!--通过手机号码查询医生信息-->
<select
id=
"getDoctorInfoByMobile"
parameterType=
"java.lang.String"
resultMap=
"BaseResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM p_doctor
where mobile_phone = #{phone}
and delete_flag = 1
</select>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Integer"
>
select
<include
refid=
"Base_Column_List"
/>
from p_doctor
where id = #{id,jdbcType=INTEGER}
</select>
<!--根据手机号获取数据-->
<!--<select id="getDoctorInfoByMobile" resultType="com.pica.cloud.account.account.server.entity.DoctorEntity"-->
<!--parameterType="java.lang.String">-->
<!--SELECT aa.id, aa.sex, aa.unionid, aa.name, aa.mobile_phone, aa.status, aa.type, aa.hospital_id, aa.department_id,-->
<!--aa.title_id, ifnull(bb.name,aa.hospital) as hospital,-->
<!--ifnull(pde.name,aa.department) as department, ifnull(pt.name,aa.title) as title, aa.cert_image_url,-->
<!--aa.avatar_image_url, aa.auth_time, aa.invite_start_time, aa.honor, aa.skills, aa.thumb_up_num, aa.email,-->
<!--aa.qrcode, aa.nickname, aa.personal_sign, aa.delete_flag, aa.creat_id, aa.creat_time, aa.modify_id,-->
<!--aa.modify_time, aa.praise_num, aa.password, aa.info, aa.rank, aa.province, aa.city, aa.county,-->
<!--aa.province_name, aa.city_name, aa.county_name,-->
<!--aa.invite_code, aa.gaoxueya_password, aa.sms_send_num, aa.total_sms_send_num, aa.entire_flag, aa.doctor_project_type,-->
<!--aa.administer_title_id, aa.administer_title,-->
<!--pded.school_name, pded.major_id, pded.major_name, pded.education_id, pded.education_name, pded.year-->
<!--FROM-->
<!--p_doctor aa-->
<!--left join-->
<!--p_hospital bb-->
<!--on aa.hospital_id = bb.id and bb.delete_flag=1-->
<!--left join-->
<!--p_title pt-->
<!--on aa.title_id = pt.title_id-->
<!--left join-->
<!--p_department pde-->
<!--on aa.department_id = pde.id-->
<!--left join-->
<!--p_doctor_education pded-->
<!--on pded.doctor_id = aa.id-->
<!--where aa.mobile_phone = #{mobile}-->
<!--and aa.delete_flag = 1-->
<!--limit 0,1-->
<!--</select>-->
<!--通过账户id更新用户信息-->
<update
id=
"updateByAcctId"
parameterType=
"com.pica.cloud.account.account.server.entity.Doctor"
>
update p_doctor
<set>
<if
test=
"sex != null"
>
sex = #{sex,jdbcType=INTEGER},
</if>
<if
test=
"name != null"
>
name = #{name,jdbcType=VARCHAR},
</if>
<if
test=
"mobilePhone != null"
>
mobile_phone = #{mobilePhone,jdbcType=VARCHAR},
</if>
<if
test=
"tel != null"
>
tel = #{tel,jdbcType=VARCHAR},
</if>
<if
test=
"status != null"
>
status = #{status,jdbcType=INTEGER},
</if>
<if
test=
"type != null"
>
type = #{type,jdbcType=INTEGER},
</if>
<if
test=
"hospitalId != null"
>
hospital_id = #{hospitalId,jdbcType=INTEGER},
</if>
<if
test=
"departmentId != null"
>
department_id = #{departmentId,jdbcType=INTEGER},
</if>
<if
test=
"titleId != null"
>
title_id = #{titleId,jdbcType=INTEGER},
</if>
<if
test=
"hospital != null"
>
hospital = #{hospital,jdbcType=VARCHAR},
</if>
<if
test=
"department != null"
>
department = #{department,jdbcType=VARCHAR},
</if>
<if
test=
"title != null"
>
title = #{title,jdbcType=VARCHAR},
</if>
<if
test=
"certImageUrl != null"
>
cert_image_url = #{certImageUrl,jdbcType=VARCHAR},
</if>
<if
test=
"avatarImageUrl != null"
>
avatar_image_url = #{avatarImageUrl,jdbcType=VARCHAR},
</if>
<if
test=
"authTime != null"
>
auth_time = #{authTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"honor != null"
>
honor = #{honor,jdbcType=VARCHAR},
</if>
<if
test=
"skills != null"
>
skills = #{skills,jdbcType=VARCHAR},
</if>
<if
test=
"thumbUpNum != null"
>
thumb_up_num = #{thumbUpNum,jdbcType=INTEGER},
</if>
<if
test=
"email != null"
>
email = #{email,jdbcType=VARCHAR},
</if>
<if
test=
"qrcode != null"
>
qrcode = #{qrcode,jdbcType=VARCHAR},
</if>
<if
test=
"nickname != null"
>
nickname = #{nickname,jdbcType=VARCHAR},
</if>
<if
test=
"personalSign != null"
>
personal_sign = #{personalSign,jdbcType=VARCHAR},
</if>
<if
test=
"deleteFlag != null"
>
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if
test=
"creatId != null"
>
creat_id = #{creatId,jdbcType=INTEGER},
</if>
<if
test=
"creatTime != null"
>
creat_time = #{creatTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"modifyId != null"
>
modify_id = #{modifyId,jdbcType=INTEGER},
</if>
<if
test=
"modifyTime != null"
>
modify_time = #{modifyTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"praiseNum != null"
>
praise_num = #{praiseNum,jdbcType=INTEGER},
</if>
<if
test=
"password != null"
>
password = #{password,jdbcType=VARCHAR},
</if>
<if
test=
"info != null"
>
info = #{info,jdbcType=VARCHAR},
</if>
<if
test=
"rank != null"
>
rank = #{rank,jdbcType=VARCHAR},
</if>
<if
test=
"province != null"
>
province = #{province,jdbcType=BIGINT},
</if>
<if
test=
"provinceName != null"
>
province_name = #{provinceName,jdbcType=VARCHAR},
</if>
<if
test=
"city != null"
>
city = #{city,jdbcType=BIGINT},
</if>
<if
test=
"cityName != null"
>
city_name = #{cityName,jdbcType=VARCHAR},
</if>
<if
test=
"county != null"
>
county = #{county,jdbcType=BIGINT},
</if>
<if
test=
"countyName != null"
>
county_name = #{countyName,jdbcType=VARCHAR},
</if>
<if
test=
"town != null"
>
town = #{town,jdbcType=BIGINT},
</if>
<if
test=
"townName != null"
>
town_name = #{townName,jdbcType=VARCHAR},
</if>
<if
test=
"inviteCode != null"
>
invite_code = #{inviteCode,jdbcType=VARCHAR},
</if>
<if
test=
"inviteStartTime != null"
>
invite_start_time = #{inviteStartTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"gaoxueyaPassword != null"
>
gaoxueya_password = #{gaoxueyaPassword,jdbcType=VARCHAR},
</if>
<if
test=
"smsSendNum != null"
>
sms_send_num = #{smsSendNum,jdbcType=INTEGER},
</if>
<if
test=
"totalSmsSendNum != null"
>
total_sms_send_num = #{totalSmsSendNum,jdbcType=INTEGER},
</if>
<if
test=
"entireFlag != null"
>
entire_flag = #{entireFlag,jdbcType=INTEGER},
</if>
<if
test=
"doctorProjectType != null"
>
doctor_project_type = #{doctorProjectType,jdbcType=INTEGER},
</if>
<if
test=
"regTime != null"
>
reg_time = #{regTime,jdbcType=DATE},
</if>
<if
test=
"lastLoginTime != null"
>
last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"unionid != null"
>
unionid = #{unionid,jdbcType=VARCHAR},
</if>
<if
test=
"registerSource != null"
>
register_source = #{registerSource,jdbcType=INTEGER},
</if>
<if
test=
"comment != null"
>
comment = #{comment,jdbcType=VARCHAR},
</if>
<if
test=
"administerTitleId != null"
>
administer_title_id = #{administerTitleId,jdbcType=INTEGER},
</if>
<if
test=
"administerTitle != null"
>
administer_title = #{administerTitle,jdbcType=VARCHAR},
</if>
<if
test=
"registerType != null"
>
register_type = #{registerType,jdbcType=INTEGER},
</if>
<if
test=
"firstLoginTime != null"
>
first_login_time = #{firstLoginTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"card != null"
>
card = #{card,jdbcType=VARCHAR},
</if>
<if
test=
"birthday != null"
>
birthday = #{birthday,jdbcType=DATE},
</if>
<if
test=
"showFlag != null"
>
show_flag = #{showFlag,jdbcType=INTEGER},
</if>
<if
test=
"acctId != null"
>
acct_id = #{acctId,jdbcType=INTEGER},
</if>
</set>
where acct_id = #{acctId,jdbcType=INTEGER}
</update>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer"
>
delete from p_doctor
where id = #{id,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
parameterType=
"com.pica.cloud.account.account.server.entity.Doctor"
>
insert into p_doctor (id, sex, name,
mobile_phone, tel, status,
type, hospital_id, department_id,
title_id, hospital, department,
title, cert_image_url, avatar_image_url,
auth_time, honor, skills,
thumb_up_num, email, qrcode,
nickname, personal_sign, delete_flag,
creat_id, creat_time, modify_id,
modify_time, praise_num, password,
info, rank, province,
province_name, city, city_name,
county, county_name, town,
town_name, invite_code, invite_start_time,
gaoxueya_password, sms_send_num, total_sms_send_num,
entire_flag, doctor_project_type, reg_time,
last_login_time, unionid, register_source,
comment, administer_title_id, administer_title,
register_type, first_login_time, card,
birthday, show_flag, acct_id
)
values (#{id,jdbcType=INTEGER}, #{sex,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},
#{mobilePhone,jdbcType=VARCHAR}, #{tel,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
#{type,jdbcType=INTEGER}, #{hospitalId,jdbcType=INTEGER}, #{departmentId,jdbcType=INTEGER},
#{titleId,jdbcType=INTEGER}, #{hospital,jdbcType=VARCHAR}, #{department,jdbcType=VARCHAR},
#{title,jdbcType=VARCHAR}, #{certImageUrl,jdbcType=VARCHAR}, #{avatarImageUrl,jdbcType=VARCHAR},
#{authTime,jdbcType=TIMESTAMP}, #{honor,jdbcType=VARCHAR}, #{skills,jdbcType=VARCHAR},
#{thumbUpNum,jdbcType=INTEGER}, #{email,jdbcType=VARCHAR}, #{qrcode,jdbcType=VARCHAR},
#{nickname,jdbcType=VARCHAR}, #{personalSign,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=INTEGER},
#{creatId,jdbcType=INTEGER}, #{creatTime,jdbcType=TIMESTAMP}, #{modifyId,jdbcType=INTEGER},
#{modifyTime,jdbcType=TIMESTAMP}, #{praiseNum,jdbcType=INTEGER}, #{password,jdbcType=VARCHAR},
#{info,jdbcType=VARCHAR}, #{rank,jdbcType=VARCHAR}, #{province,jdbcType=BIGINT},
#{provinceName,jdbcType=VARCHAR}, #{city,jdbcType=BIGINT}, #{cityName,jdbcType=VARCHAR},
#{county,jdbcType=BIGINT}, #{countyName,jdbcType=VARCHAR}, #{town,jdbcType=BIGINT},
#{townName,jdbcType=VARCHAR}, #{inviteCode,jdbcType=VARCHAR}, #{inviteStartTime,jdbcType=TIMESTAMP},
#{gaoxueyaPassword,jdbcType=VARCHAR}, #{smsSendNum,jdbcType=INTEGER}, #{totalSmsSendNum,jdbcType=INTEGER},
#{entireFlag,jdbcType=BIT}, #{doctorProjectType,jdbcType=INTEGER}, #{regTime,jdbcType=DATE},
#{lastLoginTime,jdbcType=TIMESTAMP}, #{unionid,jdbcType=VARCHAR}, #{registerSource,jdbcType=INTEGER},
#{comment,jdbcType=VARCHAR}, #{administerTitleId,jdbcType=INTEGER}, #{administerTitle,jdbcType=VARCHAR},
#{registerType,jdbcType=INTEGER}, #{firstLoginTime,jdbcType=TIMESTAMP}, #{card,jdbcType=VARCHAR},
#{birthday,jdbcType=DATE}, #{showFlag,jdbcType=INTEGER}, #{acctId,jdbcType=INTEGER}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.pica.cloud.account.account.server.entity.Doctor"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into p_doctor
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"sex != null"
>
sex,
</if>
<if
test=
"name != null"
>
name,
</if>
<if
test=
"mobilePhone != null"
>
mobile_phone,
</if>
<if
test=
"tel != null"
>
tel,
</if>
<if
test=
"status != null"
>
status,
</if>
<if
test=
"type != null"
>
type,
</if>
<if
test=
"hospitalId != null"
>
hospital_id,
</if>
<if
test=
"departmentId != null"
>
department_id,
</if>
<if
test=
"titleId != null"
>
title_id,
</if>
<if
test=
"hospital != null"
>
hospital,
</if>
<if
test=
"department != null"
>
department,
</if>
<if
test=
"title != null"
>
title,
</if>
<if
test=
"certImageUrl != null"
>
cert_image_url,
</if>
<if
test=
"avatarImageUrl != null"
>
avatar_image_url,
</if>
<if
test=
"authTime != null"
>
auth_time,
</if>
<if
test=
"honor != null"
>
honor,
</if>
<if
test=
"skills != null"
>
skills,
</if>
<if
test=
"thumbUpNum != null"
>
thumb_up_num,
</if>
<if
test=
"email != null"
>
email,
</if>
<if
test=
"qrcode != null"
>
qrcode,
</if>
<if
test=
"nickname != null"
>
nickname,
</if>
<if
test=
"personalSign != null"
>
personal_sign,
</if>
<if
test=
"deleteFlag != null"
>
delete_flag,
</if>
<if
test=
"creatId != null"
>
creat_id,
</if>
<if
test=
"creatTime != null"
>
creat_time,
</if>
<if
test=
"modifyId != null"
>
modify_id,
</if>
<if
test=
"modifyTime != null"
>
modify_time,
</if>
<if
test=
"praiseNum != null"
>
praise_num,
</if>
<if
test=
"password != null"
>
password,
</if>
<if
test=
"info != null"
>
info,
</if>
<if
test=
"rank != null"
>
rank,
</if>
<if
test=
"province != null"
>
province,
</if>
<if
test=
"provinceName != null"
>
province_name,
</if>
<if
test=
"city != null"
>
city,
</if>
<if
test=
"cityName != null"
>
city_name,
</if>
<if
test=
"county != null"
>
county,
</if>
<if
test=
"countyName != null"
>
county_name,
</if>
<if
test=
"town != null"
>
town,
</if>
<if
test=
"townName != null"
>
town_name,
</if>
<if
test=
"inviteCode != null"
>
invite_code,
</if>
<if
test=
"inviteStartTime != null"
>
invite_start_time,
</if>
<if
test=
"gaoxueyaPassword != null"
>
gaoxueya_password,
</if>
<if
test=
"smsSendNum != null"
>
sms_send_num,
</if>
<if
test=
"totalSmsSendNum != null"
>
total_sms_send_num,
</if>
<if
test=
"entireFlag != null"
>
entire_flag,
</if>
<if
test=
"doctorProjectType != null"
>
doctor_project_type,
</if>
<if
test=
"regTime != null"
>
reg_time,
</if>
<if
test=
"lastLoginTime != null"
>
last_login_time,
</if>
<if
test=
"unionid != null"
>
unionid,
</if>
<if
test=
"registerSource != null"
>
register_source,
</if>
<if
test=
"comment != null"
>
comment,
</if>
<if
test=
"administerTitleId != null"
>
administer_title_id,
</if>
<if
test=
"administerTitle != null"
>
administer_title,
</if>
<if
test=
"registerType != null"
>
register_type,
</if>
<if
test=
"firstLoginTime != null"
>
first_login_time,
</if>
<if
test=
"card != null"
>
card,
</if>
<if
test=
"birthday != null"
>
birthday,
</if>
<if
test=
"showFlag != null"
>
show_flag,
</if>
<if
test=
"acctId != null"
>
acct_id,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id,jdbcType=INTEGER},
</if>
<if
test=
"sex != null"
>
#{sex,jdbcType=INTEGER},
</if>
<if
test=
"name != null"
>
#{name,jdbcType=VARCHAR},
</if>
<if
test=
"mobilePhone != null"
>
#{mobilePhone,jdbcType=VARCHAR},
</if>
<if
test=
"tel != null"
>
#{tel,jdbcType=VARCHAR},
</if>
<if
test=
"status != null"
>
#{status,jdbcType=INTEGER},
</if>
<if
test=
"type != null"
>
#{type,jdbcType=INTEGER},
</if>
<if
test=
"hospitalId != null"
>
#{hospitalId,jdbcType=INTEGER},
</if>
<if
test=
"departmentId != null"
>
#{departmentId,jdbcType=INTEGER},
</if>
<if
test=
"titleId != null"
>
#{titleId,jdbcType=INTEGER},
</if>
<if
test=
"hospital != null"
>
#{hospital,jdbcType=VARCHAR},
</if>
<if
test=
"department != null"
>
#{department,jdbcType=VARCHAR},
</if>
<if
test=
"title != null"
>
#{title,jdbcType=VARCHAR},
</if>
<if
test=
"certImageUrl != null"
>
#{certImageUrl,jdbcType=VARCHAR},
</if>
<if
test=
"avatarImageUrl != null"
>
#{avatarImageUrl,jdbcType=VARCHAR},
</if>
<if
test=
"authTime != null"
>
#{authTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"honor != null"
>
#{honor,jdbcType=VARCHAR},
</if>
<if
test=
"skills != null"
>
#{skills,jdbcType=VARCHAR},
</if>
<if
test=
"thumbUpNum != null"
>
#{thumbUpNum,jdbcType=INTEGER},
</if>
<if
test=
"email != null"
>
#{email,jdbcType=VARCHAR},
</if>
<if
test=
"qrcode != null"
>
#{qrcode,jdbcType=VARCHAR},
</if>
<if
test=
"nickname != null"
>
#{nickname,jdbcType=VARCHAR},
</if>
<if
test=
"personalSign != null"
>
#{personalSign,jdbcType=VARCHAR},
</if>
<if
test=
"deleteFlag != null"
>
#{deleteFlag,jdbcType=INTEGER},
</if>
<if
test=
"creatId != null"
>
#{creatId,jdbcType=INTEGER},
</if>
<if
test=
"creatTime != null"
>
#{creatTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"modifyId != null"
>
#{modifyId,jdbcType=INTEGER},
</if>
<if
test=
"modifyTime != null"
>
#{modifyTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"praiseNum != null"
>
#{praiseNum,jdbcType=INTEGER},
</if>
<if
test=
"password != null"
>
#{password,jdbcType=VARCHAR},
</if>
<if
test=
"info != null"
>
#{info,jdbcType=VARCHAR},
</if>
<if
test=
"rank != null"
>
#{rank,jdbcType=VARCHAR},
</if>
<if
test=
"province != null"
>
#{province,jdbcType=BIGINT},
</if>
<if
test=
"provinceName != null"
>
#{provinceName,jdbcType=VARCHAR},
</if>
<if
test=
"city != null"
>
#{city,jdbcType=BIGINT},
</if>
<if
test=
"cityName != null"
>
#{cityName,jdbcType=VARCHAR},
</if>
<if
test=
"county != null"
>
#{county,jdbcType=BIGINT},
</if>
<if
test=
"countyName != null"
>
#{countyName,jdbcType=VARCHAR},
</if>
<if
test=
"town != null"
>
#{town,jdbcType=BIGINT},
</if>
<if
test=
"townName != null"
>
#{townName,jdbcType=VARCHAR},
</if>
<if
test=
"inviteCode != null"
>
#{inviteCode,jdbcType=VARCHAR},
</if>
<if
test=
"inviteStartTime != null"
>
#{inviteStartTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"gaoxueyaPassword != null"
>
#{gaoxueyaPassword,jdbcType=VARCHAR},
</if>
<if
test=
"smsSendNum != null"
>
#{smsSendNum,jdbcType=INTEGER},
</if>
<if
test=
"totalSmsSendNum != null"
>
#{totalSmsSendNum,jdbcType=INTEGER},
</if>
<if
test=
"entireFlag != null"
>
#{entireFlag,jdbcType=BIT},
</if>
<if
test=
"doctorProjectType != null"
>
#{doctorProjectType,jdbcType=INTEGER},
</if>
<if
test=
"regTime != null"
>
#{regTime,jdbcType=DATE},
</if>
<if
test=
"lastLoginTime != null"
>
#{lastLoginTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"unionid != null"
>
#{unionid,jdbcType=VARCHAR},
</if>
<if
test=
"registerSource != null"
>
#{registerSource,jdbcType=INTEGER},
</if>
<if
test=
"comment != null"
>
#{comment,jdbcType=VARCHAR},
</if>
<if
test=
"administerTitleId != null"
>
#{administerTitleId,jdbcType=INTEGER},
</if>
<if
test=
"administerTitle != null"
>
#{administerTitle,jdbcType=VARCHAR},
</if>
<if
test=
"registerType != null"
>
#{registerType,jdbcType=INTEGER},
</if>
<if
test=
"firstLoginTime != null"
>
#{firstLoginTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"card != null"
>
#{card,jdbcType=VARCHAR},
</if>
<if
test=
"birthday != null"
>
#{birthday,jdbcType=DATE},
</if>
<if
test=
"showFlag != null"
>
#{showFlag,jdbcType=INTEGER},
</if>
<if
test=
"acctId != null"
>
#{acctId,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.pica.cloud.account.account.server.entity.Doctor"
>
update p_doctor
<set>
<if
test=
"sex != null"
>
sex = #{sex,jdbcType=INTEGER},
</if>
<if
test=
"name != null"
>
name = #{name,jdbcType=VARCHAR},
</if>
<if
test=
"mobilePhone != null"
>
mobile_phone = #{mobilePhone,jdbcType=VARCHAR},
</if>
<if
test=
"tel != null"
>
tel = #{tel,jdbcType=VARCHAR},
</if>
<if
test=
"status != null"
>
status = #{status,jdbcType=INTEGER},
</if>
<if
test=
"type != null"
>
type = #{type,jdbcType=INTEGER},
</if>
<if
test=
"hospitalId != null"
>
hospital_id = #{hospitalId,jdbcType=INTEGER},
</if>
<if
test=
"departmentId != null"
>
department_id = #{departmentId,jdbcType=INTEGER},
</if>
<if
test=
"titleId != null"
>
title_id = #{titleId,jdbcType=INTEGER},
</if>
<if
test=
"hospital != null"
>
hospital = #{hospital,jdbcType=VARCHAR},
</if>
<if
test=
"department != null"
>
department = #{department,jdbcType=VARCHAR},
</if>
<if
test=
"title != null"
>
title = #{title,jdbcType=VARCHAR},
</if>
<if
test=
"certImageUrl != null"
>
cert_image_url = #{certImageUrl,jdbcType=VARCHAR},
</if>
<if
test=
"avatarImageUrl != null"
>
avatar_image_url = #{avatarImageUrl,jdbcType=VARCHAR},
</if>
<if
test=
"authTime != null"
>
auth_time = #{authTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"honor != null"
>
honor = #{honor,jdbcType=VARCHAR},
</if>
<if
test=
"skills != null"
>
skills = #{skills,jdbcType=VARCHAR},
</if>
<if
test=
"thumbUpNum != null"
>
thumb_up_num = #{thumbUpNum,jdbcType=INTEGER},
</if>
<if
test=
"email != null"
>
email = #{email,jdbcType=VARCHAR},
</if>
<if
test=
"qrcode != null"
>
qrcode = #{qrcode,jdbcType=VARCHAR},
</if>
<if
test=
"nickname != null"
>
nickname = #{nickname,jdbcType=VARCHAR},
</if>
<if
test=
"personalSign != null"
>
personal_sign = #{personalSign,jdbcType=VARCHAR},
</if>
<if
test=
"deleteFlag != null"
>
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if
test=
"creatId != null"
>
creat_id = #{creatId,jdbcType=INTEGER},
</if>
<if
test=
"creatTime != null"
>
creat_time = #{creatTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"modifyId != null"
>
modify_id = #{modifyId,jdbcType=INTEGER},
</if>
<if
test=
"modifyTime != null"
>
modify_time = #{modifyTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"praiseNum != null"
>
praise_num = #{praiseNum,jdbcType=INTEGER},
</if>
<if
test=
"password != null"
>
password = #{password,jdbcType=VARCHAR},
</if>
<if
test=
"info != null"
>
info = #{info,jdbcType=VARCHAR},
</if>
<if
test=
"rank != null"
>
rank = #{rank,jdbcType=VARCHAR},
</if>
<if
test=
"province != null"
>
province = #{province,jdbcType=BIGINT},
</if>
<if
test=
"provinceName != null"
>
province_name = #{provinceName,jdbcType=VARCHAR},
</if>
<if
test=
"city != null"
>
city = #{city,jdbcType=BIGINT},
</if>
<if
test=
"cityName != null"
>
city_name = #{cityName,jdbcType=VARCHAR},
</if>
<if
test=
"county != null"
>
county = #{county,jdbcType=BIGINT},
</if>
<if
test=
"countyName != null"
>
county_name = #{countyName,jdbcType=VARCHAR},
</if>
<if
test=
"town != null"
>
town = #{town,jdbcType=BIGINT},
</if>
<if
test=
"townName != null"
>
town_name = #{townName,jdbcType=VARCHAR},
</if>
<if
test=
"inviteCode != null"
>
invite_code = #{inviteCode,jdbcType=VARCHAR},
</if>
<if
test=
"inviteStartTime != null"
>
invite_start_time = #{inviteStartTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"gaoxueyaPassword != null"
>
gaoxueya_password = #{gaoxueyaPassword,jdbcType=VARCHAR},
</if>
<if
test=
"smsSendNum != null"
>
sms_send_num = #{smsSendNum,jdbcType=INTEGER},
</if>
<if
test=
"totalSmsSendNum != null"
>
total_sms_send_num = #{totalSmsSendNum,jdbcType=INTEGER},
</if>
<if
test=
"entireFlag != null"
>
entire_flag = #{entireFlag,jdbcType=INTEGER},
</if>
<if
test=
"doctorProjectType != null"
>
doctor_project_type = #{doctorProjectType,jdbcType=INTEGER},
</if>
<if
test=
"regTime != null"
>
reg_time = #{regTime,jdbcType=DATE},
</if>
<if
test=
"lastLoginTime != null"
>
last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"unionid != null"
>
unionid = #{unionid,jdbcType=VARCHAR},
</if>
<if
test=
"registerSource != null"
>
register_source = #{registerSource,jdbcType=INTEGER},
</if>
<if
test=
"comment != null"
>
comment = #{comment,jdbcType=VARCHAR},
</if>
<if
test=
"administerTitleId != null"
>
administer_title_id = #{administerTitleId,jdbcType=INTEGER},
</if>
<if
test=
"administerTitle != null"
>
administer_title = #{administerTitle,jdbcType=VARCHAR},
</if>
<if
test=
"registerType != null"
>
register_type = #{registerType,jdbcType=INTEGER},
</if>
<if
test=
"firstLoginTime != null"
>
first_login_time = #{firstLoginTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"card != null"
>
card = #{card,jdbcType=VARCHAR},
</if>
<if
test=
"birthday != null"
>
birthday = #{birthday,jdbcType=DATE},
</if>
<if
test=
"showFlag != null"
>
show_flag = #{showFlag,jdbcType=INTEGER},
</if>
<if
test=
"acctId != null"
>
acct_id = #{acctId,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.pica.cloud.account.account.server.entity.Doctor"
>
update p_doctor
set sex = #{sex,jdbcType=INTEGER},
name = #{name,jdbcType=VARCHAR},
mobile_phone = #{mobilePhone,jdbcType=VARCHAR},
tel = #{tel,jdbcType=VARCHAR},
status = #{status,jdbcType=INTEGER},
type = #{type,jdbcType=INTEGER},
hospital_id = #{hospitalId,jdbcType=INTEGER},
department_id = #{departmentId,jdbcType=INTEGER},
title_id = #{titleId,jdbcType=INTEGER},
hospital = #{hospital,jdbcType=VARCHAR},
department = #{department,jdbcType=VARCHAR},
title = #{title,jdbcType=VARCHAR},
cert_image_url = #{certImageUrl,jdbcType=VARCHAR},
avatar_image_url = #{avatarImageUrl,jdbcType=VARCHAR},
auth_time = #{authTime,jdbcType=TIMESTAMP},
honor = #{honor,jdbcType=VARCHAR},
skills = #{skills,jdbcType=VARCHAR},
thumb_up_num = #{thumbUpNum,jdbcType=INTEGER},
email = #{email,jdbcType=VARCHAR},
qrcode = #{qrcode,jdbcType=VARCHAR},
nickname = #{nickname,jdbcType=VARCHAR},
personal_sign = #{personalSign,jdbcType=VARCHAR},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
creat_id = #{creatId,jdbcType=INTEGER},
creat_time = #{creatTime,jdbcType=TIMESTAMP},
modify_id = #{modifyId,jdbcType=INTEGER},
modify_time = #{modifyTime,jdbcType=TIMESTAMP},
praise_num = #{praiseNum,jdbcType=INTEGER},
password = #{password,jdbcType=VARCHAR},
info = #{info,jdbcType=VARCHAR},
rank = #{rank,jdbcType=VARCHAR},
province = #{province,jdbcType=BIGINT},
province_name = #{provinceName,jdbcType=VARCHAR},
city = #{city,jdbcType=BIGINT},
city_name = #{cityName,jdbcType=VARCHAR},
county = #{county,jdbcType=BIGINT},
county_name = #{countyName,jdbcType=VARCHAR},
town = #{town,jdbcType=BIGINT},
town_name = #{townName,jdbcType=VARCHAR},
invite_code = #{inviteCode,jdbcType=VARCHAR},
invite_start_time = #{inviteStartTime,jdbcType=TIMESTAMP},
gaoxueya_password = #{gaoxueyaPassword,jdbcType=VARCHAR},
sms_send_num = #{smsSendNum,jdbcType=INTEGER},
total_sms_send_num = #{totalSmsSendNum,jdbcType=INTEGER},
entire_flag = #{entireFlag,jdbcType=INTEGER},
doctor_project_type = #{doctorProjectType,jdbcType=INTEGER},
reg_time = #{regTime,jdbcType=DATE},
last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
unionid = #{unionid,jdbcType=VARCHAR},
register_source = #{registerSource,jdbcType=INTEGER},
comment = #{comment,jdbcType=VARCHAR},
administer_title_id = #{administerTitleId,jdbcType=INTEGER},
administer_title = #{administerTitle,jdbcType=VARCHAR},
register_type = #{registerType,jdbcType=INTEGER},
first_login_time = #{firstLoginTime,jdbcType=TIMESTAMP},
card = #{card,jdbcType=VARCHAR},
birthday = #{birthday,jdbcType=DATE},
show_flag = #{showFlag,jdbcType=INTEGER},
acct_id = #{acctId,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<update
id=
"bindWeChat"
>
update p_doctor
set unionid = #{unionId}
where acct_id = #{acctId}
</update>
<update
id=
"unbindWeChat"
>
update p_doctor
set unionid = ''
where acct_id = #{acctId}
</update>
<select
id=
"queryDoctor"
resultType=
"com.pica.cloud.account.account.server.entity.PICAPDoctor"
parameterType=
"java.lang.Long"
>
SELECT aa.id, aa.sex, aa.name, aa.mobile_phone, aa.status,
aa.type, aa.hospital_id, aa.department_id, aa.title_id,aa.card,
aa.hospital as hospital, aa.department, aa.title, aa.cert_image_url,
aa.avatar_image_url, aa.auth_time, aa.honor, aa.skills, aa.thumb_up_num, aa.email,
aa.qrcode, aa.nickname, aa.personal_sign, aa.delete_flag, aa.creat_id, aa.creat_time,
aa.modify_id, aa.modify_time, aa.praise_num, aa.password, aa.info, aa.rank, aa.province,
aa.city, aa.county, aa.invite_code, aa.gaoxueya_password, aa.sms_send_num, aa.total_sms_send_num,
aa.entire_flag, aa.doctor_project_type,aa.invite_start_time
FROM p_doctor aa
where aa.id = #{doctorId} and aa.delete_flag = 1
</select>
</mapper>
\ No newline at end of file
server/src/main/resources/mybatis/LogLoginEntityMapper.xml
0 → 100644
浏览文件 @
753091e7
<?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.LogLoginMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pica.cloud.account.account.server.entity.LogLoginEntity"
>
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<result
column=
"acct_id"
property=
"acctId"
jdbcType=
"INTEGER"
/>
<result
column=
"acct_name"
property=
"acctName"
jdbcType=
"VARCHAR"
/>
<result
column=
"product_type"
property=
"productType"
jdbcType=
"TINYINT"
/>
<result
column=
"source_type"
property=
"sourceType"
jdbcType=
"TINYINT"
/>
<result
column=
"login_type"
property=
"loginType"
jdbcType=
"TINYINT"
/>
<result
column=
"login_ip"
property=
"loginIp"
jdbcType=
"VARCHAR"
/>
<result
column=
"login_time"
property=
"loginTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"login_status"
property=
"loginStatus"
jdbcType=
"TINYINT"
/>
<result
column=
"create_id"
property=
"createId"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"modify_id"
property=
"modifyId"
jdbcType=
"INTEGER"
/>
<result
column=
"modify_time"
property=
"modifyTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"delete_flag"
property=
"deleteFlag"
jdbcType=
"TINYINT"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, acct_id, acct_name, product_type, source_type, login_type, login_ip, login_time,
login_status, create_id, create_time, modify_id, modify_time, delete_flag
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Integer"
>
select
<include
refid=
"Base_Column_List"
/>
from log_login
where id = #{id,jdbcType=INTEGER}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer"
>
delete from log_login
where id = #{id,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
parameterType=
"com.pica.cloud.account.account.server.entity.LogLoginEntity"
>
insert into log_login (id, acct_id, acct_name,
product_type, source_type, login_type,
login_ip, login_time, login_status,
create_id, create_time, modify_id,
modify_time, delete_flag)
values (#{id,jdbcType=INTEGER}, #{acctId,jdbcType=INTEGER}, #{acctName,jdbcType=VARCHAR},
#{productType,jdbcType=TINYINT}, #{sourceType,jdbcType=TINYINT}, #{loginType,jdbcType=TINYINT},
#{loginIp,jdbcType=VARCHAR}, #{loginTime,jdbcType=TIMESTAMP}, #{loginStatus,jdbcType=TINYINT},
#{createId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{modifyId,jdbcType=INTEGER},
#{modifyTime,jdbcType=TIMESTAMP}, #{deleteFlag,jdbcType=TINYINT})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.pica.cloud.account.account.server.entity.LogLoginEntity"
>
insert into log_login
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"acctId != null"
>
acct_id,
</if>
<if
test=
"acctName != null"
>
acct_name,
</if>
<if
test=
"productType != null"
>
product_type,
</if>
<if
test=
"sourceType != null"
>
source_type,
</if>
<if
test=
"loginType != null"
>
login_type,
</if>
<if
test=
"loginIp != null"
>
login_ip,
</if>
<if
test=
"loginTime != null"
>
login_time,
</if>
<if
test=
"loginStatus != null"
>
login_status,
</if>
<if
test=
"createId != null"
>
create_id,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"modifyId != null"
>
modify_id,
</if>
<if
test=
"modifyTime != null"
>
modify_time,
</if>
<if
test=
"deleteFlag != null"
>
delete_flag,
</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=
"acctName != null"
>
#{acctName,jdbcType=VARCHAR},
</if>
<if
test=
"productType != null"
>
#{productType,jdbcType=TINYINT},
</if>
<if
test=
"sourceType != null"
>
#{sourceType,jdbcType=TINYINT},
</if>
<if
test=
"loginType != null"
>
#{loginType,jdbcType=TINYINT},
</if>
<if
test=
"loginIp != null"
>
#{loginIp,jdbcType=VARCHAR},
</if>
<if
test=
"loginTime != null"
>
#{loginTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"loginStatus != null"
>
#{loginStatus,jdbcType=TINYINT},
</if>
<if
test=
"createId != null"
>
#{createId,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"modifyId != null"
>
#{modifyId,jdbcType=INTEGER},
</if>
<if
test=
"modifyTime != null"
>
#{modifyTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"deleteFlag != null"
>
#{deleteFlag,jdbcType=TINYINT},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.pica.cloud.account.account.server.entity.LogLoginEntity"
>
update log_login
<set
>
<if
test=
"acctId != null"
>
acct_id = #{acctId,jdbcType=INTEGER},
</if>
<if
test=
"acctName != null"
>
acct_name = #{acctName,jdbcType=VARCHAR},
</if>
<if
test=
"productType != null"
>
product_type = #{productType,jdbcType=TINYINT},
</if>
<if
test=
"sourceType != null"
>
source_type = #{sourceType,jdbcType=TINYINT},
</if>
<if
test=
"loginType != null"
>
login_type = #{loginType,jdbcType=TINYINT},
</if>
<if
test=
"loginIp != null"
>
login_ip = #{loginIp,jdbcType=VARCHAR},
</if>
<if
test=
"loginTime != null"
>
login_time = #{loginTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"loginStatus != null"
>
login_status = #{loginStatus,jdbcType=TINYINT},
</if>
<if
test=
"createId != null"
>
create_id = #{createId,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"modifyId != null"
>
modify_id = #{modifyId,jdbcType=INTEGER},
</if>
<if
test=
"modifyTime != null"
>
modify_time = #{modifyTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"deleteFlag != null"
>
delete_flag = #{deleteFlag,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.pica.cloud.account.account.server.entity.LogLoginEntity"
>
update log_login
set acct_id = #{acctId,jdbcType=INTEGER},
acct_name = #{acctName,jdbcType=VARCHAR},
product_type = #{productType,jdbcType=TINYINT},
source_type = #{sourceType,jdbcType=TINYINT},
login_type = #{loginType,jdbcType=TINYINT},
login_ip = #{loginIp,jdbcType=VARCHAR},
login_time = #{loginTime,jdbcType=TIMESTAMP},
login_status = #{loginStatus,jdbcType=TINYINT},
create_id = #{createId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
modify_id = #{modifyId,jdbcType=INTEGER},
modify_time = #{modifyTime,jdbcType=TIMESTAMP},
delete_flag = #{deleteFlag,jdbcType=TINYINT}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
server/src/main/resources/mybatis/LogPWDModifyEntityMapper.xml
0 → 100644
浏览文件 @
753091e7
<?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.LogPWDModifyMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pica.cloud.account.account.server.entity.LogPWDModifyEntity"
>
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<result
column=
"mobile_phone"
property=
"mobilePhone"
jdbcType=
"VARCHAR"
/>
<result
column=
"modified_time"
property=
"modifiedTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"modified_id"
property=
"modifiedId"
jdbcType=
"INTEGER"
/>
<result
column=
"old_pwd"
property=
"oldPwd"
jdbcType=
"VARCHAR"
/>
<result
column=
"new_pwd"
property=
"newPwd"
jdbcType=
"VARCHAR"
/>
<result
column=
"delete_flag"
property=
"deleteFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"created_id"
property=
"createdId"
jdbcType=
"INTEGER"
/>
<result
column=
"created_time"
property=
"createdTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, mobile_phone, modified_time, modified_id, old_pwd, new_pwd, delete_flag, created_id,
created_time
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Integer"
>
select
<include
refid=
"Base_Column_List"
/>
from log_pwd_modify
where id = #{id,jdbcType=INTEGER}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer"
>
delete from log_pwd_modify
where id = #{id,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
parameterType=
"com.pica.cloud.account.account.server.entity.LogPWDModifyEntity"
>
insert into log_pwd_modify (mobile_phone, modified_time,
modified_id, old_pwd, new_pwd,
delete_flag, created_id, created_time
)
values (#{mobilePhone,jdbcType=VARCHAR}, #{modifiedTime,jdbcType=TIMESTAMP},
#{modifiedId,jdbcType=INTEGER}, #{oldPwd,jdbcType=VARCHAR}, #{newPwd,jdbcType=VARCHAR},
#{deleteFlag,jdbcType=INTEGER}, #{createdId,jdbcType=INTEGER}, #{createdTime,jdbcType=TIMESTAMP}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.pica.cloud.account.account.server.entity.LogPWDModifyEntity"
>
insert into log_pwd_modify
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"mobilePhone != null"
>
mobile_phone,
</if>
<if
test=
"modifiedTime != null"
>
modified_time,
</if>
<if
test=
"modifiedId != null"
>
modified_id,
</if>
<if
test=
"oldPwd != null"
>
old_pwd,
</if>
<if
test=
"newPwd != null"
>
new_pwd,
</if>
<if
test=
"deleteFlag != null"
>
delete_flag,
</if>
<if
test=
"createdId != null"
>
created_id,
</if>
<if
test=
"createdTime != null"
>
created_time,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id,jdbcType=INTEGER},
</if>
<if
test=
"mobilePhone != null"
>
#{mobilePhone,jdbcType=VARCHAR},
</if>
<if
test=
"modifiedTime != null"
>
#{modifiedTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"modifiedId != null"
>
#{modifiedId,jdbcType=INTEGER},
</if>
<if
test=
"oldPwd != null"
>
#{oldPwd,jdbcType=VARCHAR},
</if>
<if
test=
"newPwd != null"
>
#{newPwd,jdbcType=VARCHAR},
</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>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.pica.cloud.account.account.server.entity.LogPWDModifyEntity"
>
update log_pwd_modify
<set
>
<if
test=
"mobilePhone != null"
>
mobile_phone = #{mobilePhone,jdbcType=VARCHAR},
</if>
<if
test=
"modifiedTime != null"
>
modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"modifiedId != null"
>
modified_id = #{modifiedId,jdbcType=INTEGER},
</if>
<if
test=
"oldPwd != null"
>
old_pwd = #{oldPwd,jdbcType=VARCHAR},
</if>
<if
test=
"newPwd != null"
>
new_pwd = #{newPwd,jdbcType=VARCHAR},
</if>
<if
test=
"deleteFlag != null"
>
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if
test=
"createdId != null"
>
created_id = #{createdId,jdbcType=INTEGER},
</if>
<if
test=
"createdTime != null"
>
created_time = #{createdTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.pica.cloud.account.account.server.entity.LogPWDModifyEntity"
>
update log_pwd_modify
set mobile_phone = #{mobilePhone,jdbcType=VARCHAR},
modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
modified_id = #{modifiedId,jdbcType=INTEGER},
old_pwd = #{oldPwd,jdbcType=VARCHAR},
new_pwd = #{newPwd,jdbcType=VARCHAR},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
created_id = #{createdId,jdbcType=INTEGER},
created_time = #{createdTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
server/src/main/resources/mybatis/LogUserInfoEntityMapper.xml
0 → 100644
浏览文件 @
753091e7
<?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.LogUserInfoMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pica.cloud.account.account.server.entity.LogUserInfoEntity"
>
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<result
column=
"acct_id"
property=
"acctId"
jdbcType=
"INTEGER"
/>
<result
column=
"village_name"
property=
"villageName"
jdbcType=
"VARCHAR"
/>
<result
column=
"village_id"
property=
"villageId"
jdbcType=
"BIGINT"
/>
<result
column=
"town_name"
property=
"townName"
jdbcType=
"VARCHAR"
/>
<result
column=
"town_id"
property=
"townId"
jdbcType=
"BIGINT"
/>
<result
column=
"county_name"
property=
"countyName"
jdbcType=
"VARCHAR"
/>
<result
column=
"county_id"
property=
"countyId"
jdbcType=
"BIGINT"
/>
<result
column=
"city_name"
property=
"cityName"
jdbcType=
"VARCHAR"
/>
<result
column=
"city_id"
property=
"cityId"
jdbcType=
"BIGINT"
/>
<result
column=
"province_name"
property=
"provinceName"
jdbcType=
"VARCHAR"
/>
<result
column=
"province_id"
property=
"provinceId"
jdbcType=
"BIGINT"
/>
<result
column=
"country"
property=
"country"
jdbcType=
"BIGINT"
/>
<result
column=
"head_img_url"
property=
"headImgUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"address"
property=
"address"
jdbcType=
"VARCHAR"
/>
<result
column=
"patient_address"
property=
"patientAddress"
jdbcType=
"VARCHAR"
/>
<result
column=
"telephone"
property=
"telephone"
jdbcType=
"VARCHAR"
/>
<result
column=
"social_card"
property=
"socialCard"
jdbcType=
"VARCHAR"
/>
<result
column=
"work_unit"
property=
"workUnit"
jdbcType=
"VARCHAR"
/>
<result
column=
"health_file_number"
property=
"healthFileNumber"
jdbcType=
"VARCHAR"
/>
<result
column=
"payment_type"
property=
"paymentType"
jdbcType=
"VARCHAR"
/>
<result
column=
"remarks"
property=
"remarks"
jdbcType=
"VARCHAR"
/>
<result
column=
"email"
property=
"email"
jdbcType=
"VARCHAR"
/>
<result
column=
"nation"
property=
"nation"
jdbcType=
"VARCHAR"
/>
<result
column=
"create_id"
property=
"createId"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"modify_id"
property=
"modifyId"
jdbcType=
"INTEGER"
/>
<result
column=
"modify_time"
property=
"modifyTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"delete_flag"
property=
"deleteFlag"
jdbcType=
"TINYINT"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, acct_id, village_name, village_id, town_name, town_id, county_name, county_id,
city_name, city_id, province_name, province_id, country, head_img_url, address, patient_address,
telephone, social_card, work_unit, health_file_number, payment_type, remarks, email,
nation, create_id, create_time, modify_id, modify_time, delete_flag
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Integer"
>
select
<include
refid=
"Base_Column_List"
/>
from log_user_info_modify
where id = #{id,jdbcType=INTEGER}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer"
>
delete from log_user_info_modify
where id = #{id,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
parameterType=
"com.pica.cloud.account.account.server.entity.LogUserInfoEntity"
>
insert into log_user_info_modify (id, acct_id, village_name,
village_id, town_name, town_id,
county_name, county_id, city_name,
city_id, province_name, province_id,
country, head_img_url, address,
patient_address, telephone, social_card,
work_unit, health_file_number, payment_type,
remarks, email, nation,
create_id, create_time, modify_id,
modify_time, delete_flag)
values (#{id,jdbcType=INTEGER}, #{acctId,jdbcType=INTEGER}, #{villageName,jdbcType=VARCHAR},
#{villageId,jdbcType=BIGINT}, #{townName,jdbcType=VARCHAR}, #{townId,jdbcType=BIGINT},
#{countyName,jdbcType=VARCHAR}, #{countyId,jdbcType=BIGINT}, #{cityName,jdbcType=VARCHAR},
#{cityId,jdbcType=BIGINT}, #{provinceName,jdbcType=VARCHAR}, #{provinceId,jdbcType=BIGINT},
#{country,jdbcType=BIGINT}, #{headImgUrl,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
#{patientAddress,jdbcType=VARCHAR}, #{telephone,jdbcType=VARCHAR}, #{socialCard,jdbcType=VARCHAR},
#{workUnit,jdbcType=VARCHAR}, #{healthFileNumber,jdbcType=VARCHAR}, #{paymentType,jdbcType=VARCHAR},
#{remarks,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{nation,jdbcType=VARCHAR},
#{createId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{modifyId,jdbcType=INTEGER},
#{modifyTime,jdbcType=TIMESTAMP}, #{deleteFlag,jdbcType=TINYINT})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.pica.cloud.account.account.server.entity.LogUserInfoEntity"
>
insert into log_user_info_modify
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"acctId != null"
>
acct_id,
</if>
<if
test=
"villageName != null"
>
village_name,
</if>
<if
test=
"villageId != null"
>
village_id,
</if>
<if
test=
"townName != null"
>
town_name,
</if>
<if
test=
"townId != null"
>
town_id,
</if>
<if
test=
"countyName != null"
>
county_name,
</if>
<if
test=
"countyId != null"
>
county_id,
</if>
<if
test=
"cityName != null"
>
city_name,
</if>
<if
test=
"cityId != null"
>
city_id,
</if>
<if
test=
"provinceName != null"
>
province_name,
</if>
<if
test=
"provinceId != null"
>
province_id,
</if>
<if
test=
"country != null"
>
country,
</if>
<if
test=
"headImgUrl != null"
>
head_img_url,
</if>
<if
test=
"address != null"
>
address,
</if>
<if
test=
"patientAddress != null"
>
patient_address,
</if>
<if
test=
"telephone != null"
>
telephone,
</if>
<if
test=
"socialCard != null"
>
social_card,
</if>
<if
test=
"workUnit != null"
>
work_unit,
</if>
<if
test=
"healthFileNumber != null"
>
health_file_number,
</if>
<if
test=
"paymentType != null"
>
payment_type,
</if>
<if
test=
"remarks != null"
>
remarks,
</if>
<if
test=
"email != null"
>
email,
</if>
<if
test=
"nation != null"
>
nation,
</if>
<if
test=
"createId != null"
>
create_id,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"modifyId != null"
>
modify_id,
</if>
<if
test=
"modifyTime != null"
>
modify_time,
</if>
<if
test=
"deleteFlag != null"
>
delete_flag,
</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=
"villageName != null"
>
#{villageName,jdbcType=VARCHAR},
</if>
<if
test=
"villageId != null"
>
#{villageId,jdbcType=BIGINT},
</if>
<if
test=
"townName != null"
>
#{townName,jdbcType=VARCHAR},
</if>
<if
test=
"townId != null"
>
#{townId,jdbcType=BIGINT},
</if>
<if
test=
"countyName != null"
>
#{countyName,jdbcType=VARCHAR},
</if>
<if
test=
"countyId != null"
>
#{countyId,jdbcType=BIGINT},
</if>
<if
test=
"cityName != null"
>
#{cityName,jdbcType=VARCHAR},
</if>
<if
test=
"cityId != null"
>
#{cityId,jdbcType=BIGINT},
</if>
<if
test=
"provinceName != null"
>
#{provinceName,jdbcType=VARCHAR},
</if>
<if
test=
"provinceId != null"
>
#{provinceId,jdbcType=BIGINT},
</if>
<if
test=
"country != null"
>
#{country,jdbcType=BIGINT},
</if>
<if
test=
"headImgUrl != null"
>
#{headImgUrl,jdbcType=VARCHAR},
</if>
<if
test=
"address != null"
>
#{address,jdbcType=VARCHAR},
</if>
<if
test=
"patientAddress != null"
>
#{patientAddress,jdbcType=VARCHAR},
</if>
<if
test=
"telephone != null"
>
#{telephone,jdbcType=VARCHAR},
</if>
<if
test=
"socialCard != null"
>
#{socialCard,jdbcType=VARCHAR},
</if>
<if
test=
"workUnit != null"
>
#{workUnit,jdbcType=VARCHAR},
</if>
<if
test=
"healthFileNumber != null"
>
#{healthFileNumber,jdbcType=VARCHAR},
</if>
<if
test=
"paymentType != null"
>
#{paymentType,jdbcType=VARCHAR},
</if>
<if
test=
"remarks != null"
>
#{remarks,jdbcType=VARCHAR},
</if>
<if
test=
"email != null"
>
#{email,jdbcType=VARCHAR},
</if>
<if
test=
"nation != null"
>
#{nation,jdbcType=VARCHAR},
</if>
<if
test=
"createId != null"
>
#{createId,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"modifyId != null"
>
#{modifyId,jdbcType=INTEGER},
</if>
<if
test=
"modifyTime != null"
>
#{modifyTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"deleteFlag != null"
>
#{deleteFlag,jdbcType=TINYINT},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.pica.cloud.account.account.server.entity.LogUserInfoEntity"
>
update log_user_info_modify
<set
>
<if
test=
"acctId != null"
>
acct_id = #{acctId,jdbcType=INTEGER},
</if>
<if
test=
"villageName != null"
>
village_name = #{villageName,jdbcType=VARCHAR},
</if>
<if
test=
"villageId != null"
>
village_id = #{villageId,jdbcType=BIGINT},
</if>
<if
test=
"townName != null"
>
town_name = #{townName,jdbcType=VARCHAR},
</if>
<if
test=
"townId != null"
>
town_id = #{townId,jdbcType=BIGINT},
</if>
<if
test=
"countyName != null"
>
county_name = #{countyName,jdbcType=VARCHAR},
</if>
<if
test=
"countyId != null"
>
county_id = #{countyId,jdbcType=BIGINT},
</if>
<if
test=
"cityName != null"
>
city_name = #{cityName,jdbcType=VARCHAR},
</if>
<if
test=
"cityId != null"
>
city_id = #{cityId,jdbcType=BIGINT},
</if>
<if
test=
"provinceName != null"
>
province_name = #{provinceName,jdbcType=VARCHAR},
</if>
<if
test=
"provinceId != null"
>
province_id = #{provinceId,jdbcType=BIGINT},
</if>
<if
test=
"country != null"
>
country = #{country,jdbcType=BIGINT},
</if>
<if
test=
"headImgUrl != null"
>
head_img_url = #{headImgUrl,jdbcType=VARCHAR},
</if>
<if
test=
"address != null"
>
address = #{address,jdbcType=VARCHAR},
</if>
<if
test=
"patientAddress != null"
>
patient_address = #{patientAddress,jdbcType=VARCHAR},
</if>
<if
test=
"telephone != null"
>
telephone = #{telephone,jdbcType=VARCHAR},
</if>
<if
test=
"socialCard != null"
>
social_card = #{socialCard,jdbcType=VARCHAR},
</if>
<if
test=
"workUnit != null"
>
work_unit = #{workUnit,jdbcType=VARCHAR},
</if>
<if
test=
"healthFileNumber != null"
>
health_file_number = #{healthFileNumber,jdbcType=VARCHAR},
</if>
<if
test=
"paymentType != null"
>
payment_type = #{paymentType,jdbcType=VARCHAR},
</if>
<if
test=
"remarks != null"
>
remarks = #{remarks,jdbcType=VARCHAR},
</if>
<if
test=
"email != null"
>
email = #{email,jdbcType=VARCHAR},
</if>
<if
test=
"nation != null"
>
nation = #{nation,jdbcType=VARCHAR},
</if>
<if
test=
"createId != null"
>
create_id = #{createId,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"modifyId != null"
>
modify_id = #{modifyId,jdbcType=INTEGER},
</if>
<if
test=
"modifyTime != null"
>
modify_time = #{modifyTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"deleteFlag != null"
>
delete_flag = #{deleteFlag,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.pica.cloud.account.account.server.entity.LogUserInfoEntity"
>
update log_user_info_modify
set acct_id = #{acctId,jdbcType=INTEGER},
village_name = #{villageName,jdbcType=VARCHAR},
village_id = #{villageId,jdbcType=BIGINT},
town_name = #{townName,jdbcType=VARCHAR},
town_id = #{townId,jdbcType=BIGINT},
county_name = #{countyName,jdbcType=VARCHAR},
county_id = #{countyId,jdbcType=BIGINT},
city_name = #{cityName,jdbcType=VARCHAR},
city_id = #{cityId,jdbcType=BIGINT},
province_name = #{provinceName,jdbcType=VARCHAR},
province_id = #{provinceId,jdbcType=BIGINT},
country = #{country,jdbcType=BIGINT},
head_img_url = #{headImgUrl,jdbcType=VARCHAR},
address = #{address,jdbcType=VARCHAR},
patient_address = #{patientAddress,jdbcType=VARCHAR},
telephone = #{telephone,jdbcType=VARCHAR},
social_card = #{socialCard,jdbcType=VARCHAR},
work_unit = #{workUnit,jdbcType=VARCHAR},
health_file_number = #{healthFileNumber,jdbcType=VARCHAR},
payment_type = #{paymentType,jdbcType=VARCHAR},
remarks = #{remarks,jdbcType=VARCHAR},
email = #{email,jdbcType=VARCHAR},
nation = #{nation,jdbcType=VARCHAR},
create_id = #{createId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
modify_id = #{modifyId,jdbcType=INTEGER},
modify_time = #{modifyTime,jdbcType=TIMESTAMP},
delete_flag = #{deleteFlag,jdbcType=TINYINT}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录