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
提交
6f2ef06b
提交
6f2ef06b
编写于
9月 03, 2021
作者:
chenzhehao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix--垃圾的utils升级
上级
6f964293
流水线
#37728
已失败 于阶段
变更
5
流水线
1
展开全部
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
66 行增加
和
63 行删除
+66
-63
pom.xml
server/pom.xml
+16
-16
AccountBaseController.java
...ount/account/server/controller/AccountBaseController.java
+19
-17
AccountInfoController.java
...ount/account/server/controller/AccountInfoController.java
+3
-2
DoctorController.java
...d/account/account/server/controller/DoctorController.java
+1
-1
LoginController.java
...ud/account/account/server/controller/LoginController.java
+27
-27
未找到文件。
server/pom.xml
浏览文件 @
6f2ef06b
...
@@ -63,18 +63,7 @@
...
@@ -63,18 +63,7 @@
<dependency>
<dependency>
<groupId>
com.pica.cloud.foundation
</groupId>
<groupId>
com.pica.cloud.foundation
</groupId>
<artifactId>
pica-cloud-service-starter
</artifactId>
<artifactId>
pica-cloud-service-starter
</artifactId>
<version>
1.2.6-SNAPSHOT
</version>
<version>
1.4.2
</version>
<!--<version>1.3.2.5</version>-->
<exclusions>
<exclusion>
<artifactId>
pica-cloud-redis
</artifactId>
<groupId>
com.pica.cloud.foundation
</groupId>
</exclusion>
<exclusion>
<artifactId>
pica-cloud-entity
</artifactId>
<groupId>
com.pica.cloud.foundation
</groupId>
</exclusion>
</exclusions>
</dependency>
</dependency>
<dependency>
<dependency>
...
@@ -115,20 +104,31 @@
...
@@ -115,20 +104,31 @@
<version>
2.1.0
</version>
<version>
2.1.0
</version>
</dependency>
</dependency>
<dependency>
<groupId>
commons-io
</groupId>
<artifactId>
commons-io
</artifactId>
<version>
2.6
</version>
</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>
<
!-- <version>1.3.2-OLD</version>--
>
<
version>
1.4.4
</version
>
<
version>
1.4.0-OLD
</version
>
<
scope>
provided
</scope
>
<exclusions>
<exclusions>
<exclusion>
<exclusion>
<artifactId>
jedis
</artifactId>
<artifactId>
servlet-api
</artifactId>
<groupId>
redis.clients
</groupId>
<groupId>
javax.servlet
</groupId>
</exclusion>
</exclusion>
</exclusions>
</exclusions>
</dependency>
</dependency>
<dependency>
<groupId>
com.pica.cloud.foundation
</groupId>
<artifactId>
pica-cloud-redis
</artifactId>
<version>
1.4.0
</version>
</dependency>
<dependency>
<dependency>
<groupId>
redis.clients
</groupId>
<groupId>
redis.clients
</groupId>
<artifactId>
jedis
</artifactId>
<artifactId>
jedis
</artifactId>
...
...
server/src/main/java/com/pica/cloud/account/account/server/controller/AccountBaseController.java
浏览文件 @
6f2ef06b
...
@@ -15,8 +15,9 @@ import com.pica.cloud.foundation.entity.PicaException;
...
@@ -15,8 +15,9 @@ import com.pica.cloud.foundation.entity.PicaException;
import
com.pica.cloud.foundation.entity.PicaResponse
;
import
com.pica.cloud.foundation.entity.PicaResponse
;
import
com.pica.cloud.foundation.entity.PicaResultCode
;
import
com.pica.cloud.foundation.entity.PicaResultCode
;
import
com.pica.cloud.foundation.entity.PicaWarnException
;
import
com.pica.cloud.foundation.entity.PicaWarnException
;
import
com.pica.cloud.foundation.redis.ICacheClient
;
import
com.pica.cloud.foundation.service.starter.common.BaseController
;
import
com.pica.cloud.foundation.utils.constants.SysCode
;
import
com.pica.cloud.foundation.utils.constants.SysCode
;
import
com.pica.cloud.foundation.utils.controller.BaseController
;
import
com.pica.cloud.foundation.utils.entity.PicaUser
;
import
com.pica.cloud.foundation.utils.entity.PicaUser
;
import
com.pica.cloud.foundation.utils.utils.HttpClientUtil
;
import
com.pica.cloud.foundation.utils.utils.HttpClientUtil
;
import
com.pica.cloud.foundation.utils.utils.MD5Util
;
import
com.pica.cloud.foundation.utils.utils.MD5Util
;
...
@@ -27,7 +28,9 @@ import org.slf4j.LoggerFactory;
...
@@ -27,7 +28,9 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Map
;
import
java.util.Objects
;
/**
/**
* controller基类
* controller基类
...
@@ -38,9 +41,6 @@ import java.util.*;
...
@@ -38,9 +41,6 @@ import java.util.*;
public
abstract
class
AccountBaseController
extends
BaseController
{
public
abstract
class
AccountBaseController
extends
BaseController
{
private
static
final
String
KEY_PREFIX
=
"token-doctor-"
;
private
static
final
String
KEY_PREFIX
=
"token-doctor-"
;
private
Logger
logger
=
LoggerFactory
.
getLogger
(
AccountBaseController
.
class
);
private
Logger
logger
=
LoggerFactory
.
getLogger
(
AccountBaseController
.
class
);
@Autowired
@Autowired
...
@@ -48,6 +48,8 @@ public abstract class AccountBaseController extends BaseController {
...
@@ -48,6 +48,8 @@ public abstract class AccountBaseController extends BaseController {
@Autowired
@Autowired
private
IntactUtil
intactUtil
;
private
IntactUtil
intactUtil
;
@Autowired
private
ICacheClient
cacheClient
;
//从token获取医生ID
//从token获取医生ID
public
long
getDoctorIdByToken
()
{
public
long
getDoctorIdByToken
()
{
...
@@ -61,7 +63,7 @@ public abstract class AccountBaseController extends BaseController {
...
@@ -61,7 +63,7 @@ public abstract class AccountBaseController extends BaseController {
//获取deviceInfo信息
//获取deviceInfo信息
public
String
getDeviceInfo
(
String
key
)
{
public
String
getDeviceInfo
(
String
key
)
{
String
deviceInfo
=
super
.
getDeviceInfo
(
);
String
deviceInfo
=
this
.
getRequest
().
getHeader
(
"deviceInfo"
);
if
(
StringUtils
.
isBlank
(
key
)
||
StringUtils
.
isBlank
(
deviceInfo
))
{
if
(
StringUtils
.
isBlank
(
key
)
||
StringUtils
.
isBlank
(
deviceInfo
))
{
return
StringUtils
.
EMPTY
;
return
StringUtils
.
EMPTY
;
}
}
...
@@ -92,14 +94,14 @@ public abstract class AccountBaseController extends BaseController {
...
@@ -92,14 +94,14 @@ public abstract class AccountBaseController extends BaseController {
picaUser
.
setToken
(
token
);
picaUser
.
setToken
(
token
);
}
}
String
sysCode
=
super
.
getSysCode
(
);
String
sysCode
=
this
.
getRequest
().
getHeader
(
"sysCode"
);
if
(
"9"
.
equals
(
sysCode
))
{
if
(
"9"
.
equals
(
sysCode
))
{
sysCode
=
"saas"
;
sysCode
=
"saas"
;
}
else
if
(
"10"
.
equals
(
sysCode
))
{
}
else
if
(
"10"
.
equals
(
sysCode
))
{
sysCode
=
"app"
;
sysCode
=
"app"
;
}
}
String
tokenValue
=
super
.
getRedisClient
()
.
get
(
KEY_PREFIX
+
picaUser
.
getId
().
toString
()
+
"-"
+
sysCode
);
String
tokenValue
=
cacheClient
.
get
(
KEY_PREFIX
+
picaUser
.
getId
().
toString
()
+
"-"
+
sysCode
);
if
(
StringUtils
.
isNotBlank
(
tokenValue
))
{
if
(
StringUtils
.
isNotBlank
(
tokenValue
))
{
return
tokenValue
.
replace
(
"token-"
,
""
);
//token已经存在则直接返回
return
tokenValue
.
replace
(
"token-"
,
""
);
//token已经存在则直接返回
}
}
...
@@ -107,7 +109,7 @@ public abstract class AccountBaseController extends BaseController {
...
@@ -107,7 +109,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
cacheClient
.
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
;
...
@@ -118,8 +120,8 @@ public abstract class AccountBaseController extends BaseController {
...
@@ -118,8 +120,8 @@ public abstract class AccountBaseController extends BaseController {
public
void
sendMobileMessage
(
String
mobile
,
String
content
,
long
senderId
)
{
public
void
sendMobileMessage
(
String
mobile
,
String
content
,
long
senderId
)
{
//接入新旭事务一致性
//接入新旭事务一致性
String
batchNo
=
IntactUtils
.
getUUID
();
String
batchNo
=
IntactUtils
.
getUUID
();
intactUtil
.
sendIntact
(
batchNo
,
"sendMobileMessage"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_1
,
"mobile:"
+
mobile
+
",content:"
+
content
+
",senderId:"
+
senderId
);
intactUtil
.
sendIntact
(
batchNo
,
"sendMobileMessage"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_1
,
"mobile:"
+
mobile
+
",content:"
+
content
+
",senderId:"
+
senderId
);
String
sysCodeStr
=
super
.
getSysCode
(
);
String
sysCodeStr
=
this
.
getRequest
().
getHeader
(
"sysCode"
);
int
sysCode
=
10
;
//默认移动端
int
sysCode
=
10
;
//默认移动端
if
(
StringUtils
.
isNotBlank
(
sysCodeStr
))
{
if
(
StringUtils
.
isNotBlank
(
sysCodeStr
))
{
try
{
try
{
...
@@ -151,13 +153,13 @@ public abstract class AccountBaseController extends BaseController {
...
@@ -151,13 +153,13 @@ public abstract class AccountBaseController extends BaseController {
picapSendMsgModel
.
setSysName
(
SysCode
.
APP
.
sysName
());
picapSendMsgModel
.
setSysName
(
SysCode
.
APP
.
sysName
());
String
postData
=
JSON
.
toJSONString
(
picapSendMsgModel
);
String
postData
=
JSON
.
toJSONString
(
picapSendMsgModel
);
logger
.
info
(
"sendMobileTo-mobile:{}, senderId-{}"
,
mobile
,
senderId
);
logger
.
info
(
"sendMobileTo-mobile:{}, senderId-{}"
,
mobile
,
senderId
);
long
start
=
System
.
currentTimeMillis
();
long
start
=
System
.
currentTimeMillis
();
String
jsonObj
=
HttpClientUtil
.
httpExecute
(
messageUrl
,
postData
);
String
jsonObj
=
HttpClientUtil
.
httpExecute
(
messageUrl
,
postData
);
intactUtil
.
sendIntact
(
batchNo
,
"sendMobileMessage"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_3
,
"jsonObj:"
+
jsonObj
);
intactUtil
.
sendIntact
(
batchNo
,
"sendMobileMessage"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_3
,
"jsonObj:"
+
jsonObj
);
long
end1
=
System
.
currentTimeMillis
();
long
end1
=
System
.
currentTimeMillis
();
logger
.
info
(
"sendMobileMessage-send message used {} million seconds"
,
end1
-
start
);
logger
.
info
(
"sendMobileMessage-send message used {} million seconds"
,
end1
-
start
);
logger
.
info
(
"sendMobileTo-{}"
,
jsonObj
);
logger
.
info
(
"sendMobileTo-{}"
,
jsonObj
);
if
(
StringUtils
.
isEmpty
(
jsonObj
))
{
if
(
StringUtils
.
isEmpty
(
jsonObj
))
{
...
@@ -167,7 +169,7 @@ public abstract class AccountBaseController extends BaseController {
...
@@ -167,7 +169,7 @@ public abstract class AccountBaseController extends BaseController {
}
}
try
{
try
{
PicaResponse
resp
=
JSON
.
parseObject
(
jsonObj
,
PicaResponse
.
class
);
PicaResponse
resp
=
JSON
.
parseObject
(
jsonObj
,
PicaResponse
.
class
);
if
(
Objects
.
nonNull
(
resp
)
&&
PicaResultCode
.
SUCCESS
.
code
().
equals
(
resp
.
getCode
()))
{
if
(
Objects
.
nonNull
(
resp
)
&&
PicaResultCode
.
SUCCESS
.
code
().
equals
(
resp
.
getCode
()))
{
logger
.
info
(
"send message success, the result is: {}"
,
jsonObj
);
logger
.
info
(
"send message success, the result is: {}"
,
jsonObj
);
}
else
{
}
else
{
logger
.
error
(
"send message fail, response code not equals success code"
);
logger
.
error
(
"send message fail, response code not equals success code"
);
...
@@ -189,8 +191,8 @@ public abstract class AccountBaseController extends BaseController {
...
@@ -189,8 +191,8 @@ public abstract class AccountBaseController extends BaseController {
*/
*/
public
AccountUser
getAccountUser
()
{
public
AccountUser
getAccountUser
()
{
//把所有请求头信息都封装到当前模型中
//把所有请求头信息都封装到当前模型中
String
token
=
this
.
get
Token
(
);
String
token
=
this
.
get
Request
().
getHeader
(
"token"
);
AccountUser
accountUser
=
super
.
getRedisClient
()
.
getToken
(
token
,
AccountUser
.
class
);
AccountUser
accountUser
=
cacheClient
.
getToken
(
token
,
AccountUser
.
class
);
accountUser
.
setLoginFrom
(
this
.
getSourceType
());
accountUser
.
setLoginFrom
(
this
.
getSourceType
());
accountUser
.
setLoginPlatform
(
this
.
getProductType
());
accountUser
.
setLoginPlatform
(
this
.
getProductType
());
accountUser
.
setLoginIp
(
super
.
getIpAddr
());
accountUser
.
setLoginIp
(
super
.
getIpAddr
());
...
...
server/src/main/java/com/pica/cloud/account/account/server/controller/AccountInfoController.java
浏览文件 @
6f2ef06b
...
@@ -10,9 +10,10 @@ import com.pica.cloud.foundation.entity.PicaResponse;
...
@@ -10,9 +10,10 @@ import com.pica.cloud.foundation.entity.PicaResponse;
import
com.pica.cloud.foundation.service.starter.interceptor.EnabledLoginValidate
;
import
com.pica.cloud.foundation.service.starter.interceptor.EnabledLoginValidate
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -68,7 +69,7 @@ public class AccountInfoController extends AccountBaseController {
...
@@ -68,7 +69,7 @@ public class AccountInfoController extends AccountBaseController {
@ApiOperation
(
"批量获取医生wechat信息"
)
@ApiOperation
(
"批量获取医生wechat信息"
)
@PostMapping
(
"/wechat/batch"
)
@PostMapping
(
"/wechat/batch"
)
public
PicaResponse
<
Map
<
Integer
,
String
>>
getWechatInfoBatch
(
@RequestBody
List
<
Integer
>
docIds
)
{
public
PicaResponse
<
Map
<
Integer
,
String
>>
getWechatInfoBatch
(
@RequestBody
List
<
Integer
>
docIds
)
{
return
PicaResponse
.
toResponse
(
wechatService
.
getAccountWechatInfoBatch
(
docIds
));
return
PicaResponse
.
toResponse
(
wechatService
.
getAccountWechatInfoBatch
(
docIds
));
}
}
...
...
server/src/main/java/com/pica/cloud/account/account/server/controller/DoctorController.java
浏览文件 @
6f2ef06b
...
@@ -45,7 +45,7 @@ public class DoctorController extends AccountBaseController {
...
@@ -45,7 +45,7 @@ public class DoctorController extends AccountBaseController {
Integer
userId
=
accountUser
.
getId
();
Integer
userId
=
accountUser
.
getId
();
Doctor
doctorInfo
=
doctorService
.
getDoctorInfo
(
userId
);
Doctor
doctorInfo
=
doctorService
.
getDoctorInfo
(
userId
);
String
mobilePhone
=
doctorInfo
.
getMobilePhone
();
String
mobilePhone
=
doctorInfo
.
getMobilePhone
();
String
dencrypt
=
EncryptUtils
.
decryptContent
(
mobilePhone
,
EncryptConstants
.
ENCRYPT_TYPE_MOBILE
,
super
.
getToken
(
));
String
dencrypt
=
EncryptUtils
.
decryptContent
(
mobilePhone
,
EncryptConstants
.
ENCRYPT_TYPE_MOBILE
,
this
.
getRequest
().
getHeader
(
"token"
));
mobilePhone
=
dencrypt
.
substring
(
0
,
3
)
+
"****"
+
dencrypt
.
substring
(
7
,
11
);
mobilePhone
=
dencrypt
.
substring
(
0
,
3
)
+
"****"
+
dencrypt
.
substring
(
7
,
11
);
doctorInfo
.
setMobilePhone
(
mobilePhone
);
doctorInfo
.
setMobilePhone
(
mobilePhone
);
if
(
StringUtils
.
isNotBlank
(
doctorInfo
.
getCard
()))
{
if
(
StringUtils
.
isNotBlank
(
doctorInfo
.
getCard
()))
{
...
...
server/src/main/java/com/pica/cloud/account/account/server/controller/LoginController.java
浏览文件 @
6f2ef06b
此差异已折叠。
点击以展开。
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录