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
提交
3ede406b
提交
3ede406b
编写于
9月 02, 2019
作者:
rushui.chen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
20190902 自测完成的接口并完善
上级
8f53065c
流水线
#13875
已失败 于阶段
in 1 second
变更
15
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
386 行增加
和
47 行删除
+386
-47
Test.java
...main/java/com/pica/cloud/account/account/server/Test.java
+13
-5
AccountBaseController.java
...ount/account/server/controller/AccountBaseController.java
+2
-1
ModifyMobileController.java
...unt/account/server/controller/ModifyMobileController.java
+0
-1
PasswordController.java
...account/account/server/controller/PasswordController.java
+0
-4
SysCodeController.java
.../account/account/server/controller/SysCodeController.java
+7
-1
UserInfoController.java
...account/account/server/controller/UserInfoController.java
+9
-4
EnumsType.java
...om/pica/cloud/account/account/server/enums/EnumsType.java
+0
-3
ExceptionType.java
...ica/cloud/account/account/server/enums/ExceptionType.java
+0
-1
AccountException.java
...ud/account/account/server/exception/AccountException.java
+23
-0
PicaLogTask.java
...om/pica/cloud/account/account/server/log/PicaLogTask.java
+1
-2
PicaLogUtils.java
...m/pica/cloud/account/account/server/log/PicaLogUtils.java
+0
-1
PatientReq.java
...com/pica/cloud/account/account/server/req/PatientReq.java
+298
-0
PasswordServiceImpl.java
...ount/account/server/service/impl/PasswordServiceImpl.java
+28
-21
RegisterServiceImpl.java
...ount/account/server/service/impl/RegisterServiceImpl.java
+1
-1
LogPWDModifyEntityMapper.xml
...r/src/main/resources/mybatis/LogPWDModifyEntityMapper.xml
+4
-2
未找到文件。
server/src/main/java/com/pica/cloud/account/account/server/
service/
Test.java
→
server/src/main/java/com/pica/cloud/account/account/server/Test.java
浏览文件 @
3ede406b
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
service
;
package
com
.
pica
.
cloud
.
account
.
account
.
server
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.pica.cloud.account.account.server.entity.EncryptEntity
;
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.BaseRequest
;
import
com.pica.cloud.account.account.server.req.PatientReq
;
public
class
Test
{
public
class
Test
{
...
@@ -22,7 +23,7 @@ public class Test {
...
@@ -22,7 +23,7 @@ public class Test {
System
.
out
.
println
(
"------------------------------>"
);
System
.
out
.
println
(
"------------------------------>"
);
//获取注册参数
//获取注册参数
BaseRequest
register
=
null
;
BaseRequest
register
=
null
;
register
=
new
BaseRequest
();
register
=
new
BaseRequest
();
register
.
setMobile
(
"13024112588"
);
register
.
setMobile
(
"13024112588"
);
register
.
setPassword
(
"qq123456"
);
register
.
setPassword
(
"qq123456"
);
...
@@ -34,11 +35,18 @@ public class Test {
...
@@ -34,11 +35,18 @@ public class Test {
System
.
out
.
println
(
JSONObject
.
toJSONString
(
registerEncryptEntity
));
System
.
out
.
println
(
JSONObject
.
toJSONString
(
registerEncryptEntity
));
System
.
out
.
println
(
"------------------------------>"
);
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
));
}
}
}
}
server/src/main/java/com/pica/cloud/account/account/server/controller/AccountBaseController.java
浏览文件 @
3ede406b
...
@@ -6,6 +6,7 @@ import com.pica.cloud.account.account.server.configuration.PropertiesConfigurati
...
@@ -6,6 +6,7 @@ import com.pica.cloud.account.account.server.configuration.PropertiesConfigurati
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.entity.AccountUser
;
import
com.pica.cloud.account.account.server.enums.ExceptionType
;
import
com.pica.cloud.account.account.server.enums.ExceptionType
;
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
;
...
@@ -158,7 +159,7 @@ public abstract class AccountBaseController extends BaseController {
...
@@ -158,7 +159,7 @@ public abstract class AccountBaseController extends BaseController {
return
accountUser
.
getAcctId
();
return
accountUser
.
getAcctId
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
throw
new
PicaException
(
ExceptionType
.
PICA_LOGIN_AGAIN
.
getCode
(),
ExceptionType
.
PICA_LOGIN_AGAIN
.
getMessage
()
);
throw
new
AccountException
(
ExceptionType
.
PICA_LOGIN_AGAIN
);
}
}
}
}
...
...
server/src/main/java/com/pica/cloud/account/account/server/controller/ModifyMobileController.java
浏览文件 @
3ede406b
...
@@ -35,5 +35,4 @@ public class ModifyMobileController extends AccountBaseController {
...
@@ -35,5 +35,4 @@ public class ModifyMobileController extends AccountBaseController {
modifyMobileService
.
modify
(
acctId
,
mobile
);
modifyMobileService
.
modify
(
acctId
,
mobile
);
return
PicaResponse
.
toResponse
();
return
PicaResponse
.
toResponse
();
}
}
}
}
server/src/main/java/com/pica/cloud/account/account/server/controller/PasswordController.java
浏览文件 @
3ede406b
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
controller
;
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.EncryptEntity
;
import
com.pica.cloud.account.account.server.entity.EncryptEntity
;
import
com.pica.cloud.account.account.server.enums.EnumsType
;
import
com.pica.cloud.account.account.server.enums.EnumsType
;
import
com.pica.cloud.account.account.server.enums.ExceptionType
;
import
com.pica.cloud.account.account.server.enums.ExceptionType
;
...
@@ -30,7 +29,6 @@ public class PasswordController extends AccountBaseController {
...
@@ -30,7 +29,6 @@ public class PasswordController extends AccountBaseController {
@Autowired
@Autowired
private
AccountUtils
accountUtils
;
private
AccountUtils
accountUtils
;
/**
/**
* 修改密码
* 修改密码
*
*
...
@@ -63,14 +61,12 @@ public class PasswordController extends AccountBaseController {
...
@@ -63,14 +61,12 @@ public class PasswordController extends AccountBaseController {
@ApiOperation
(
"忘记密码接口"
)
@ApiOperation
(
"忘记密码接口"
)
@PostMapping
(
value
=
"/reset"
)
@PostMapping
(
value
=
"/reset"
)
public
PicaResponse
forgetPassword
(
@RequestBody
EncryptEntity
entity
)
throws
Exception
{
public
PicaResponse
forgetPassword
(
@RequestBody
EncryptEntity
entity
)
throws
Exception
{
Integer
acctId
=
super
.
getAcctId
();
BaseRequest
request
=
CryptoUtil
.
decrypt
(
entity
,
BaseRequest
.
class
);
BaseRequest
request
=
CryptoUtil
.
decrypt
(
entity
,
BaseRequest
.
class
);
accountUtils
.
checkMobilePhone
(
request
.
getMobile
());
accountUtils
.
checkMobilePhone
(
request
.
getMobile
());
accountUtils
.
checkAuthCode
(
request
.
getMobile
(),
EnumsType
.
SYSCODE_TYPE_RESET_PASSWORD
.
getCode
()
+
""
,
request
.
getSysCode
());
accountUtils
.
checkAuthCode
(
request
.
getMobile
(),
EnumsType
.
SYSCODE_TYPE_RESET_PASSWORD
.
getCode
()
+
""
,
request
.
getSysCode
());
if
(
StringUtils
.
isEmpty
(
request
.
getPassword
()))
{
if
(
StringUtils
.
isEmpty
(
request
.
getPassword
()))
{
throw
new
PicaException
(
ExceptionType
.
PICA_PASSWORD_ERROR
.
getCode
(),
ExceptionType
.
PICA_PASSWORD_ERROR
.
getMessage
());
throw
new
PicaException
(
ExceptionType
.
PICA_PASSWORD_ERROR
.
getCode
(),
ExceptionType
.
PICA_PASSWORD_ERROR
.
getMessage
());
}
}
request
.
setAccId
(
acctId
);
passwordService
.
forgetPassword
(
request
);
passwordService
.
forgetPassword
(
request
);
return
PicaResponse
.
toResponse
();
return
PicaResponse
.
toResponse
();
}
}
...
...
server/src/main/java/com/pica/cloud/account/account/server/controller/SysCodeController.java
浏览文件 @
3ede406b
...
@@ -42,11 +42,17 @@ public class SysCodeController extends AccountBaseController {
...
@@ -42,11 +42,17 @@ public class SysCodeController extends AccountBaseController {
private
ICacheClient
cacheClient
;
private
ICacheClient
cacheClient
;
/**
* 必须要传递flag类型
*
* @param entity
* @return
* @throws Exception
*/
@ApiOperation
(
"获取短信验证码"
)
@ApiOperation
(
"获取短信验证码"
)
@PostMapping
(
value
=
""
)
@PostMapping
(
value
=
""
)
public
PicaResponse
getSysCode
(
@RequestBody
EncryptEntity
entity
)
throws
Exception
{
public
PicaResponse
getSysCode
(
@RequestBody
EncryptEntity
entity
)
throws
Exception
{
BaseRequest
request
=
CryptoUtil
.
decrypt
(
entity
,
BaseRequest
.
class
);
BaseRequest
request
=
CryptoUtil
.
decrypt
(
entity
,
BaseRequest
.
class
);
request
.
setFlag
(
0
);
AccountUtils
.
checkMobilePhone
(
request
.
getMobile
());
AccountUtils
.
checkMobilePhone
(
request
.
getMobile
());
processSysCode
(
request
.
getMobile
(),
request
.
getFlag
());
processSysCode
(
request
.
getMobile
(),
request
.
getFlag
());
return
PicaResponse
.
toResponse
();
return
PicaResponse
.
toResponse
();
...
...
server/src/main/java/com/pica/cloud/account/account/server/controller/UserInfoController.java
浏览文件 @
3ede406b
...
@@ -2,11 +2,14 @@ package com.pica.cloud.account.account.server.controller;
...
@@ -2,11 +2,14 @@ package com.pica.cloud.account.account.server.controller;
import
com.pica.cloud.account.account.server.entity.AccountUserInfoEntity
;
import
com.pica.cloud.account.account.server.entity.AccountUserInfoEntity
;
import
com.pica.cloud.account.account.server.entity.EncryptEntity
;
import
com.pica.cloud.account.account.server.entity.EncryptEntity
;
import
com.pica.cloud.account.account.server.req.PatientReq
;
import
com.pica.cloud.account.account.server.service.UserInfoService
;
import
com.pica.cloud.account.account.server.service.UserInfoService
;
import
com.pica.cloud.account.account.server.util.BeanUtil
;
import
com.pica.cloud.account.account.server.util.CryptoUtil
;
import
com.pica.cloud.account.account.server.util.CryptoUtil
;
import
com.pica.cloud.foundation.entity.PicaResponse
;
import
com.pica.cloud.foundation.entity.PicaResponse
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
...
@@ -41,10 +44,12 @@ public class UserInfoController extends AccountBaseController {
...
@@ -41,10 +44,12 @@ public class UserInfoController extends AccountBaseController {
@ApiOperation
(
"修改用户信息"
)
@ApiOperation
(
"修改用户信息"
)
@PutMapping
(
value
=
"/user/info"
)
@PutMapping
(
value
=
"/user/info"
)
public
PicaResponse
putUserInfo
(
@RequestBody
EncryptEntity
entity
)
throws
Exception
{
public
PicaResponse
putUserInfo
(
@RequestBody
EncryptEntity
entity
)
throws
Exception
{
Integer
acctId
=
super
.
getAcctId
();
Integer
id
=
super
.
getAccountUser
().
getId
();
AccountUserInfoEntity
request
=
CryptoUtil
.
decrypt
(
entity
,
AccountUserInfoEntity
.
class
);
PatientReq
request
=
CryptoUtil
.
decrypt
(
entity
,
PatientReq
.
class
);
request
.
setAcctId
(
acctId
);
request
.
setId
(
id
);
userInfoService
.
updateUserInfo
(
request
);
AccountUserInfoEntity
accountUserInfoEntity
=
new
AccountUserInfoEntity
();
BeanUtils
.
copyProperties
(
accountUserInfoEntity
,
request
);
userInfoService
.
updateUserInfo
(
accountUserInfoEntity
);
return
PicaResponse
.
toResponse
();
return
PicaResponse
.
toResponse
();
}
}
...
...
server/src/main/java/com/pica/cloud/account/account/server/enums/EnumsType.java
浏览文件 @
3ede406b
...
@@ -45,9 +45,6 @@ public enum EnumsType {
...
@@ -45,9 +45,6 @@ public enum EnumsType {
LOG_TYPE_PASSWORD
(
2
,
"密码更新日志"
),
LOG_TYPE_PASSWORD
(
2
,
"密码更新日志"
),
LOG_TYPE_USER_INFO
(
3
,
"用户信息更新日志"
);
LOG_TYPE_USER_INFO
(
3
,
"用户信息更新日志"
);
private
int
code
;
private
int
code
;
private
String
type
;
private
String
type
;
...
...
server/src/main/java/com/pica/cloud/account/account/server/enums/ExceptionType.java
浏览文件 @
3ede406b
...
@@ -17,7 +17,6 @@ public enum ExceptionType {
...
@@ -17,7 +17,6 @@ public enum ExceptionType {
PICA_PASSWORD_EQUAL
(
"216514"
,
"旧密码与新密码不能相同"
),
PICA_PASSWORD_EQUAL
(
"216514"
,
"旧密码与新密码不能相同"
),
PICA_UNBIND_MOBILE
(
"216515"
,
"该手机号未绑定微信"
);
PICA_UNBIND_MOBILE
(
"216515"
,
"该手机号未绑定微信"
);
private
String
code
;
private
String
code
;
private
String
message
;
private
String
message
;
...
...
server/src/main/java/com/pica/cloud/account/account/server/exception/AccountException.java
0 → 100644
浏览文件 @
3ede406b
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
exception
;
import
com.pica.cloud.account.account.server.enums.ExceptionType
;
import
com.pica.cloud.foundation.entity.PicaException
;
import
com.pica.cloud.foundation.entity.PicaResultCode
;
/**
* 直接传递枚举类型
*/
public
class
AccountException
extends
PicaException
{
public
AccountException
(
String
code
,
String
msg
)
{
super
(
code
,
msg
);
}
public
AccountException
(
PicaResultCode
picaResultCode
)
{
super
(
picaResultCode
);
}
public
AccountException
(
ExceptionType
exceptionType
)
{
super
(
exceptionType
.
getCode
(),
exceptionType
.
getMessage
());
}
}
server/src/main/java/com/pica/cloud/account/account/server/log/PicaLogTask.java
浏览文件 @
3ede406b
...
@@ -21,7 +21,6 @@ public class PicaLogTask implements Runnable {
...
@@ -21,7 +21,6 @@ public class PicaLogTask implements Runnable {
private
LogUserInfoMapper
logUserInfoMapper
;
private
LogUserInfoMapper
logUserInfoMapper
;
/**
/**
* 日志类型
* 日志类型
*/
*/
...
@@ -45,7 +44,7 @@ public class PicaLogTask implements Runnable {
...
@@ -45,7 +44,7 @@ public class PicaLogTask implements Runnable {
if
(
type
==
EnumsType
.
LOG_TYPE_LOGIN
.
getCode
())
{
if
(
type
==
EnumsType
.
LOG_TYPE_LOGIN
.
getCode
())
{
loginLogMapper
.
insertSelective
((
LogLoginEntity
)
picaLogEntity
);
loginLogMapper
.
insertSelective
((
LogLoginEntity
)
picaLogEntity
);
}
else
if
(
type
==
EnumsType
.
LOG_TYPE_PASSWORD
.
getCode
())
{
}
else
if
(
type
==
EnumsType
.
LOG_TYPE_PASSWORD
.
getCode
())
{
logPWDModifyMapper
.
insert
Selective
((
LogPWDModifyEntity
)
picaLogEntity
);
logPWDModifyMapper
.
insert
((
LogPWDModifyEntity
)
picaLogEntity
);
}
else
if
(
type
==
EnumsType
.
LOG_TYPE_USER_INFO
.
getCode
())
{
}
else
if
(
type
==
EnumsType
.
LOG_TYPE_USER_INFO
.
getCode
())
{
logUserInfoMapper
.
insertSelective
((
LogUserInfoEntity
)
picaLogEntity
);
logUserInfoMapper
.
insertSelective
((
LogUserInfoEntity
)
picaLogEntity
);
}
}
...
...
server/src/main/java/com/pica/cloud/account/account/server/log/PicaLogUtils.java
浏览文件 @
3ede406b
...
@@ -4,7 +4,6 @@ import org.springframework.stereotype.Component;
...
@@ -4,7 +4,6 @@ import org.springframework.stereotype.Component;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.Future
;
@Component
@Component
public
class
PicaLogUtils
{
public
class
PicaLogUtils
{
...
...
server/src/main/java/com/pica/cloud/account/account/server/req/PatientReq.java
0 → 100644
浏览文件 @
3ede406b
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
req
;
import
java.util.Date
;
/**
* 居民信息
*/
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/impl/PasswordServiceImpl.java
浏览文件 @
3ede406b
...
@@ -4,6 +4,7 @@ import com.pica.cloud.account.account.server.entity.AccountInfoEntity;
...
@@ -4,6 +4,7 @@ import com.pica.cloud.account.account.server.entity.AccountInfoEntity;
import
com.pica.cloud.account.account.server.entity.LogPWDModifyEntity
;
import
com.pica.cloud.account.account.server.entity.LogPWDModifyEntity
;
import
com.pica.cloud.account.account.server.enums.EnumsType
;
import
com.pica.cloud.account.account.server.enums.EnumsType
;
import
com.pica.cloud.account.account.server.enums.ExceptionType
;
import
com.pica.cloud.account.account.server.enums.ExceptionType
;
import
com.pica.cloud.account.account.server.exception.AccountException
;
import
com.pica.cloud.account.account.server.log.PicaLogUtils
;
import
com.pica.cloud.account.account.server.log.PicaLogUtils
;
import
com.pica.cloud.account.account.server.mapper.AccountInfoDetailMapper
;
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.req.BaseRequest
;
...
@@ -48,31 +49,37 @@ public class PasswordServiceImpl implements PasswordService {
...
@@ -48,31 +49,37 @@ public class PasswordServiceImpl implements PasswordService {
logPWDModifyEntity
.
setLogType
(
EnumsType
.
LOG_TYPE_PASSWORD
.
getCode
());
logPWDModifyEntity
.
setLogType
(
EnumsType
.
LOG_TYPE_PASSWORD
.
getCode
());
picaLogUtils
.
info
(
logPWDModifyEntity
);
picaLogUtils
.
info
(
logPWDModifyEntity
);
}
else
{
}
else
{
throw
new
PicaException
(
ExceptionType
.
PICA_PASSWORD_ERROR
.
getCode
(),
ExceptionType
.
PICA_PASSWORD_ERROR
.
getMessage
()
);
throw
new
AccountException
(
ExceptionType
.
PICA_PASSWORD_ERROR
);
}
}
}
}
@Override
@Override
public
void
forgetPassword
(
BaseRequest
request
)
{
public
void
forgetPassword
(
BaseRequest
request
)
{
Integer
accId
=
request
.
getAccId
();
AccountInfoEntity
entity
=
accountInfoDetailMapper
.
selectByMobile
(
EncryptCreateUtil
.
encrypt
(
request
.
getMobile
()));
AccountInfoEntity
accountInfoEntity
=
new
AccountInfoEntity
();
if
(
entity
!=
null
)
{
accountInfoEntity
.
setId
(
accId
);
Integer
accId
=
entity
.
getId
();
accountInfoEntity
.
setModifiedId
(
accId
);
AccountInfoEntity
accountInfoEntity
=
new
AccountInfoEntity
();
accountInfoEntity
.
setModifiedTime
(
new
Date
());
accountInfoEntity
.
setId
(
accId
);
accountInfoEntity
.
setPassword
(
EncryptCreateUtil
.
encrypt
(
request
.
getPassword
()));
accountInfoEntity
.
setModifiedId
(
accId
);
accountInfoDetailMapper
.
updatePasswordByPrimaryKey
(
accountInfoEntity
);
accountInfoEntity
.
setModifiedTime
(
new
Date
());
//密码修改日志
accountInfoEntity
.
setPassword
(
EncryptCreateUtil
.
encrypt
(
request
.
getPassword
()));
Date
currentTime
=
new
Date
();
accountInfoDetailMapper
.
updatePasswordByPrimaryKey
(
accountInfoEntity
);
LogPWDModifyEntity
logPWDModifyEntity
=
new
LogPWDModifyEntity
();
//密码修改日志
logPWDModifyEntity
.
setCreatedId
(
accId
);
Date
currentTime
=
new
Date
();
logPWDModifyEntity
.
setCreatedTime
(
currentTime
);
LogPWDModifyEntity
logPWDModifyEntity
=
new
LogPWDModifyEntity
();
logPWDModifyEntity
.
setDeleteFlag
(
1
);
logPWDModifyEntity
.
setCreatedId
(
accId
);
logPWDModifyEntity
.
setMobilePhone
(
request
.
getMobile
());
logPWDModifyEntity
.
setCreatedTime
(
currentTime
);
logPWDModifyEntity
.
setModifiedId
(
accId
);
logPWDModifyEntity
.
setDeleteFlag
(
1
);
logPWDModifyEntity
.
setModifiedTime
(
currentTime
);
logPWDModifyEntity
.
setMobilePhone
(
entity
.
getMobilePhone
());
logPWDModifyEntity
.
setOldPwd
(
""
);
logPWDModifyEntity
.
setModifiedId
(
accId
);
logPWDModifyEntity
.
setNewPwd
(
EncryptCreateUtil
.
encrypt
(
request
.
getPassword
()));
logPWDModifyEntity
.
setModifiedTime
(
currentTime
);
logPWDModifyEntity
.
setLogType
(
EnumsType
.
LOG_TYPE_PASSWORD
.
getCode
());
logPWDModifyEntity
.
setOldPwd
(
""
);
picaLogUtils
.
info
(
logPWDModifyEntity
);
logPWDModifyEntity
.
setNewPwd
(
EncryptCreateUtil
.
encrypt
(
request
.
getPassword
()));
logPWDModifyEntity
.
setLogType
(
EnumsType
.
LOG_TYPE_PASSWORD
.
getCode
());
picaLogUtils
.
info
(
logPWDModifyEntity
);
}
else
{
//未注册,请先注册
throw
new
AccountException
(
ExceptionType
.
PICA_NOT_REGISTER
);
}
}
}
}
}
server/src/main/java/com/pica/cloud/account/account/server/service/impl/RegisterServiceImpl.java
浏览文件 @
3ede406b
...
@@ -56,7 +56,7 @@ public class RegisterServiceImpl implements RegisterService {
...
@@ -56,7 +56,7 @@ public class RegisterServiceImpl implements RegisterService {
int
sourceType
=
baseRequest
.
getSourceType
();
int
sourceType
=
baseRequest
.
getSourceType
();
AccountInfoEntity
accountInfo
=
new
AccountInfoEntity
();
AccountInfoEntity
accountInfo
=
new
AccountInfoEntity
();
accountInfo
.
setMobilePhone
(
EncryptCreateUtil
.
encrypt
(
baseRequest
.
getMobile
()));
accountInfo
.
setMobilePhone
(
EncryptCreateUtil
.
encrypt
(
baseRequest
.
getMobile
()));
if
(
!
StringUtils
.
isNotEmpty
(
baseRequest
.
getPassword
()))
{
if
(
StringUtils
.
isNotEmpty
(
baseRequest
.
getPassword
()))
{
accountInfo
.
setPassword
(
EncryptCreateUtil
.
encrypt
(
baseRequest
.
getPassword
()));
accountInfo
.
setPassword
(
EncryptCreateUtil
.
encrypt
(
baseRequest
.
getPassword
()));
}
else
{
}
else
{
accountInfo
.
setPassword
(
""
);
accountInfo
.
setPassword
(
""
);
...
...
server/src/main/resources/mybatis/LogPWDModifyEntityMapper.xml
浏览文件 @
3ede406b
...
@@ -27,15 +27,16 @@
...
@@ -27,15 +27,16 @@
where id = #{id,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</delete>
</delete>
<insert
id=
"insert"
parameterType=
"com.pica.cloud.account.account.server.entity.LogPWDModifyEntity"
>
<insert
id=
"insert"
parameterType=
"com.pica.cloud.account.account.server.entity.LogPWDModifyEntity"
>
insert into log_pwd_modify (
id, mobile_phone, modified_time,
insert into log_pwd_modify (
mobile_phone, modified_time,
modified_id, old_pwd, new_pwd,
modified_id, old_pwd, new_pwd,
delete_flag, created_id, created_time
delete_flag, created_id, created_time
)
)
values (#{
id,jdbcType=INTEGER}, #{mobilePhone,jdbcType=VARCHAR}, #{modifiedTime,jdbcType=TIMESTAMP},
values (#{
mobilePhone,jdbcType=VARCHAR}, #{modifiedTime,jdbcType=TIMESTAMP},
#{modifiedId,jdbcType=INTEGER}, #{oldPwd,jdbcType=VARCHAR}, #{newPwd,jdbcType=VARCHAR},
#{modifiedId,jdbcType=INTEGER}, #{oldPwd,jdbcType=VARCHAR}, #{newPwd,jdbcType=VARCHAR},
#{deleteFlag,jdbcType=INTEGER}, #{createdId,jdbcType=INTEGER}, #{createdTime,jdbcType=TIMESTAMP}
#{deleteFlag,jdbcType=INTEGER}, #{createdId,jdbcType=INTEGER}, #{createdTime,jdbcType=TIMESTAMP}
)
)
</insert>
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.pica.cloud.account.account.server.entity.LogPWDModifyEntity"
>
<insert
id=
"insertSelective"
parameterType=
"com.pica.cloud.account.account.server.entity.LogPWDModifyEntity"
>
insert into log_pwd_modify
insert into log_pwd_modify
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
@@ -97,6 +98,7 @@
...
@@ -97,6 +98,7 @@
</if>
</if>
</trim>
</trim>
</insert>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.pica.cloud.account.account.server.entity.LogPWDModifyEntity"
>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.pica.cloud.account.account.server.entity.LogPWDModifyEntity"
>
update log_pwd_modify
update log_pwd_modify
<set
>
<set
>
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录