Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
d5bef3b2
Commit
d5bef3b2
authored
Jul 20, 2022
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改接口
parent
ba9bfe4d
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
186 additions
and
45 deletions
+186
-45
IOrgUsrService.java
...n/amos/boot/module/common/api/service/IOrgUsrService.java
+1
-1
Msg.java
...src/main/java/com/yeejoin/amos/patrol/dao/entity/Msg.java
+11
-5
OrgPersonController.java
...oot/module/common/biz/controller/OrgPersonController.java
+7
-0
OrgUsrServiceImpl.java
...oot/module/common/biz/service/impl/OrgUsrServiceImpl.java
+9
-1
MsgController.java
...eejoin/amos/patrol/business/controller/MsgController.java
+4
-9
JcsFeignClient.java
...om/yeejoin/amos/patrol/business/feign/JcsFeignClient.java
+15
-1
NoticePublishParam.java
...eejoin/amos/patrol/business/param/NoticePublishParam.java
+25
-0
MessageServiceImpl.java
...amos/patrol/business/service/impl/MessageServiceImpl.java
+43
-23
PersonIdentifyAspect.java
.../com/yeejoin/amos/patrol/config/PersonIdentifyAspect.java
+69
-3
msgMapper.xml
...-system-patrol/src/main/resources/db/mapper/msgMapper.xml
+2
-2
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/IOrgUsrService.java
View file @
d5bef3b2
...
...
@@ -309,7 +309,7 @@ public interface IOrgUsrService {
UserDto
selectByIdUser
(
String
userId
);
List
<
OrgUsr
>
getListById
(
List
<
String
>
ids
);
/**
* 根据机构类型获取列表不分页
* @param orgTypes 机构类型(逗号分割)
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-patrol-api/src/main/java/com/yeejoin/amos/patrol/dao/entity/Msg.java
View file @
d5bef3b2
...
...
@@ -112,9 +112,6 @@ public class Msg extends BasicEntity{
private
Long
createBy
;
//单位code
@Column
(
name
=
"biz_org_code"
)
private
String
bizOrgCode
;
public
String
getBizOrgCode
()
{
return
bizOrgCode
;
...
...
@@ -131,15 +128,24 @@ public class Msg extends BasicEntity{
public
void
setBizOrgName
(
String
bizOrgName
)
{
this
.
bizOrgName
=
bizOrgName
;
}
//单位code
@Column
(
name
=
"biz_org_code"
)
private
String
bizOrgCode
;
//单位名称
@Column
(
name
=
"biz_org_name"
)
private
String
bizOrgName
;
@Column
(
name
=
"biz_user_id"
)
private
String
bizUserId
;
public
String
getBizUserId
()
{
return
bizUserId
;
}
public
void
setBizUserId
(
String
bizUserId
)
{
this
.
bizUserId
=
bizUserId
;
}
public
String
getTitle
()
{
return
title
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/OrgPersonController.java
View file @
d5bef3b2
...
...
@@ -154,6 +154,13 @@ public class OrgPersonController extends BaseController {
return
ResponseHelper
.
buildResponse
(
userDto
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/getUserList"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"获取人员详情"
,
notes
=
"获取人员详情"
)
public
ResponseModel
<
List
<
OrgUsr
>
>
getUserList
(
HttpServletRequest
request
,
@RequestBody
List
<
String
>
id
)
throws
Exception
{
List
<
OrgUsr
>
userDto
=
iOrgUsrService
.
getListById
(
id
);
return
ResponseHelper
.
buildResponse
(
userDto
);
}
/**
* @param request
* @param id
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/OrgUsrServiceImpl.java
View file @
d5bef3b2
...
...
@@ -2654,7 +2654,15 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}
}
@Override
public
List
<
OrgUsr
>
getListById
(
List
<
String
>
ids
)
{
LambdaQueryWrapper
<
OrgUsr
>
wrapper
=
new
LambdaQueryWrapper
<
OrgUsr
>();
wrapper
.
eq
(
OrgUsr:
:
getIsDelete
,
false
);
wrapper
.
in
(
OrgUsr:
:
getSequenceNbr
,
ids
);
wrapper
.
eq
(
OrgUsr:
:
getBizOrgType
,
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
List
<
OrgUsr
>
orgUsr
=
baseMapper
.
selectList
(
wrapper
);
return
orgUsr
;
}
public
String
getCompany
(
UserDto
userDto
){
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/controller/MsgController.java
View file @
d5bef3b2
...
...
@@ -98,13 +98,8 @@ public class MsgController extends AbstractBaseController {
@ApiParam
(
value
=
"查询条件"
,
required
=
false
)
@RequestBody
(
required
=
false
)
MsgInfoPageParam
param
,
@ApiParam
(
value
=
"分页参数"
,
required
=
true
,
defaultValue
=
"pageNumber=0&pageSize=10"
)
CommonPageable
commonPageable
)
{
try
{
// ReginParams reginParams = getSelectedOrgInfo();
// String loginOrgCode = getOrgCode(reginParams);
// String roleTypeName = getRoleTypeName(reginParams);
// HashMap<String, Object> paramMap = buildMybatisCriterias(loginOrgCode, roleTypeName);
// if(XJConstant.ROLE_NAME_DEPTADMIN.equals(roleTypeName)||XJConstant.ROLE_NAME_PERSON.equals(roleTypeName))
// paramMap.put("userId",getUserId());
// MsgInfoPageParam param = MsgParamUtils.fillMsgInfoParam(queryRequests, commonPageable, paramMap);
ReginParams
reginParams
=
getSelectedOrgInfo
();
param
.
setBizOrgCode
(
reginParams
.
getPersonIdentity
().
getCompanyBizOrgCode
());
Page
<
MsgVo
>
dataList
=
iMsgService
.
queryMsgInfoList
(
param
);
return
CommonResponseUtil
.
success
(
dataList
);
}
catch
(
Exception
e
)
{
...
...
@@ -126,8 +121,8 @@ public class MsgController extends AbstractBaseController {
msg
.
setUserName
(
user
.
getRealName
());
String
loginOrgCode
=
getOrgCode
(
reginParams
);
msg
.
setOrgCode
(
loginOrgCode
);
msg
.
setBizOrgCode
(
reginParams
.
getPersonIdentity
().
getBizOrgCode
());
msg
.
setBizOrgName
(
reginParams
.
getPersonIdentity
().
getCompanyName
());
List
<
Msg
>
msgList
=
iMsgService
.
publishNotice
(
getToken
(),
getProduct
(),
getAppKey
(),
msg
);
msgList
.
forEach
(
m
->{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/feign/JcsFeignClient.java
View file @
d5bef3b2
package
com
.
yeejoin
.
amos
.
patrol
.
business
.
feign
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.ws.rs.POST
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -44,7 +46,19 @@ public interface JcsFeignClient {
@GetMapping
(
value
=
"/org-usr/find/getByOrgCode"
)
ResponseModel
<
Object
>
getByOrgCode
(
@RequestParam
String
bizOrgCode
);
@GetMapping
(
value
=
"/org-usr/
/
company/bizOrgCode/list"
)
@GetMapping
(
value
=
"/org-usr/company/bizOrgCode/list"
)
ResponseModel
<
Object
>
getCompanyByBizOrgCodeList
(
@RequestParam
String
bizOrgCode
);
/**
* 查询用户单位信息
* @param userId 用户id
* @return ResponseModel<ReginParams.PersonIdentity>
*/
@GetMapping
(
value
=
"/org-person/getUser/{id}"
)
FeignClientResult
selectById
(
@PathVariable
String
id
);
@PostMapping
(
value
=
"/org-person/getUserList"
)
FeignClientResult
<
List
<
Map
<
String
,
Object
>>>
selectByIdList
(
@RequestBody
List
<
String
>
id
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/param/NoticePublishParam.java
View file @
d5bef3b2
...
...
@@ -6,6 +6,8 @@ import java.util.List;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.yeejoin.amos.patrol.common.enums.MsgTypeEnum
;
import
javax.persistence.Column
;
public
class
NoticePublishParam
{
/**
...
...
@@ -46,6 +48,29 @@ public class NoticePublishParam {
private
String
orgCode
;
//单位code
private
String
bizOrgCode
;
//单位名称
private
String
bizOrgName
;
public
String
getBizOrgCode
()
{
return
bizOrgCode
;
}
public
void
setBizOrgCode
(
String
bizOrgCode
)
{
this
.
bizOrgCode
=
bizOrgCode
;
}
public
String
getBizOrgName
()
{
return
bizOrgName
;
}
public
void
setBizOrgName
(
String
bizOrgName
)
{
this
.
bizOrgName
=
bizOrgName
;
}
public
String
getUserName
()
{
return
userName
;
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/MessageServiceImpl.java
View file @
d5bef3b2
...
...
@@ -17,13 +17,17 @@ import java.util.stream.Collectors;
import
javax.transaction.Transactional
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.patrol.business.feign.EquipFeign
;
import
com.yeejoin.amos.patrol.business.feign.JcsFeignClient
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
...
...
@@ -61,6 +65,7 @@ import com.yeejoin.amos.patrol.email.IEmailService;
import
com.yeejoin.amos.patrol.feign.PushFeignServer
;
import
com.yeejoin.amos.patrol.feign.RemoteSecurityService
;
import
com.yeejoin.amos.patrol.jpush.AppMessagePushService
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
/**
...
...
@@ -108,6 +113,11 @@ public class MessageServiceImpl implements IMessageService {
@Autowired
private
EquipFeign
equipFeign
;
@Autowired
private
JcsFeignClient
jcsFeignClient
;
@Override
public
void
pushCheckMessage
(
String
toke
,
String
product
,
String
appKey
,
Long
checkId
)
{
try
{
...
...
@@ -347,31 +357,41 @@ public class MessageServiceImpl implements IMessageService {
List
<
String
>
userIds
=
notice
.
getUserId
();
boolean
isImmediately
=
notice
.
getIsImmediately
();
List
<
Msg
>
msgList
=
new
ArrayList
<>();
List
<
AgencyUserModel
>
users
=
remoteSecurityService
.
listUserByUserIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
userIds
));
for
(
AgencyUserModel
user
:
users
)
{
String
targetTel
=
user
.
getUserName
();
Msg
msg
=
new
Msg
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy.MM.dd HH:mm:ss"
);
String
start
=
sdf
.
format
(
notice
.
getFixedTime
());
msg
.
setBody
(
notice
.
getBody
()+
"\r\n发送时间:"
+
start
);
msg
.
setIsImmediately
(
isImmediately
);
msg
.
setMsgType
(
MsgTypeEnum
.
NOTIFY
.
getCode
());
// List<AgencyUserModel> users = remoteSecurityService.listUserByUserIds(toke, product, appKey,Joiner.on(",").join(userIds));
FeignClientResult
<
List
<
Map
<
String
,
Object
>>>
responseModel
=
jcsFeignClient
.
selectByIdList
(
userIds
);
if
(
ObjectUtils
.
isEmpty
(
responseModel
.
getResult
())
||
responseModel
.
getStatus
()
!=
HttpStatus
.
OK
.
value
())
{
throw
new
RuntimeException
(
responseModel
.
getDevMessage
());
}
List
<
Map
<
String
,
Object
>>
personList
=
responseModel
.
getResult
();
if
(
personList
!=
null
&&
personList
.
size
()>
0
){
for
(
Map
<
String
,
Object
>
user
:
personList
)
{
//
Msg
msg
=
new
Msg
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy.MM.dd HH:mm:ss"
);
String
start
=
sdf
.
format
(
notice
.
getFixedTime
());
msg
.
setBody
(
notice
.
getBody
()+
"\r\n发送时间:"
+
start
);
msg
.
setIsImmediately
(
isImmediately
);
msg
.
setMsgType
(
MsgTypeEnum
.
NOTIFY
.
getCode
());
msg
.
setOrgCode
(
notice
.
getOrgCode
());
msg
.
setTargetTel
(
targetTel
);
//
msg.setTargetTel(targetTel);
msg
.
setTitle
(
MsgTypeEnum
.
NOTIFY
.
getName
());
msg
.
setUserId
(
user
.
getUserId
());
msg
.
setReciverName
(
user
.
getRealName
());
if
(
isImmediately
)
{
//立即发送
msg
=
pushMsgAndSave
(
toke
,
product
,
appKey
,
msg
);
}
else
{
//定时发送
msg
.
setStatus
(
0
);
msg
.
setFixedTime
(
notice
.
getFixedTime
());
iMsgDao
.
save
(
msg
);
msgList
.
add
(
msg
);
}
}
msg
.
setUserId
(
user
.
get
(
"amosOrgId"
)!=
null
?
user
.
get
(
"amosOrgId"
).
toString
():
""
);
msg
.
setReciverName
(
user
.
get
(
"bizOrgName"
).
toString
());
if
(
isImmediately
)
{
//立即发送
msg
=
pushMsgAndSave
(
toke
,
product
,
appKey
,
msg
);
}
else
{
//定时发送
msg
.
setStatus
(
0
);
msg
.
setFixedTime
(
notice
.
getFixedTime
());
iMsgDao
.
save
(
msg
);
msgList
.
add
(
msg
);
}
}
}
return
msgList
;
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/config/PersonIdentifyAspect.java
View file @
d5bef3b2
package
com
.
yeejoin
.
amos
.
patrol
.
config
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.patrol.business.feign.JcsFeignClient
;
import
com.yeejoin.amos.patrol.exception.PermissionException
;
import
org.apache.commons.lang3.StringUtils
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Before
;
import
org.aspectj.lang.annotation.Pointcut
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
java.util.Map
;
/**
* @description:
* @author: tw
* @createDate: 2022/7/19
* @author DELL
*/
@Aspect
@Component
@ResponseBody
@Order
(
value
=
1
)
public
class
PersonIdentifyAspect
{
@Autowired
RedisUtils
redisUtils
;
@Autowired
private
JcsFeignClient
jcsFeignClient
;
@Pointcut
(
"execution(public * com.yeejoin.amos.*.business.controller..*(..))"
)
public
void
userDate
()
{
}
@Before
(
"userDate()"
)
public
void
personIdentity
(
JoinPoint
joinPoint
)
throws
PermissionException
{
ReginParams
reginParam
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
if
(
reginParam
!=
null
)
{
if
(
reginParam
.
getPersonIdentity
()==
null
){
String
userId
=
reginParam
.
getUserModel
().
getUserId
();
if
(
userId
!=
null
){
FeignClientResult
responseModel
=
jcsFeignClient
.
selectById
(
userId
);
if
(
ObjectUtils
.
isEmpty
(
responseModel
.
getResult
())
||
responseModel
.
getStatus
()
!=
HttpStatus
.
OK
.
value
())
{
throw
new
RuntimeException
(
responseModel
.
getDevMessage
());
}
ReginParams
.
PersonIdentity
personIdentity
=
(
ReginParams
.
PersonIdentity
)
Bean
.
mapToBean
((
Map
<
String
,
Object
>)
responseModel
.
getResult
(),
ReginParams
.
PersonIdentity
.
class
);
reginParam
.
setPersonIdentity
(
personIdentity
);
redisUtils
.
set
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
()),
JSONObject
.
toJSONString
(
reginParam
));
}
}
}
}
}
amos-boot-system-patrol/src/main/resources/db/mapper/msgMapper.xml
View file @
d5bef3b2
...
...
@@ -213,7 +213,7 @@
<if
test=
"msgType != null"
>
AND m.msg_type = #{msgType}
</if>
<if
test=
"beginDate != null and beginDate != '' "
>
AND m.create_date
<![CDATA[>=]]>
#{beginDate}
</if>
<if
test=
"endDate != null and endDate != '' "
>
AND m.create_date
<![CDATA[<=]]>
#{endDate}
</if>
<if
test=
"bizOrgCode != null and bizOrgCode != '' "
>
AND m.biz_org_code
= #{bizOrgCode}
</if>
<if
test=
"bizOrgCode != null and bizOrgCode != '' "
>
AND m.biz_org_code
LIKE concat( #{bizOrgCode}, '%')
</if>
</where>
</select>
...
...
@@ -241,7 +241,7 @@
<if
test=
"msgType != null"
>
AND m.msg_type = #{msgType}
</if>
<if
test=
"beginDate != null and beginDate != '' "
>
AND m.create_date
<![CDATA[>=]]>
#{beginDate}
</if>
<if
test=
"endDate != null and endDate != '' "
>
AND m.create_date
<![CDATA[<=]]>
#{endDate}
</if>
<if
test=
"bizOrgCode != null and bizOrgCode != '' "
>
AND m.biz_org_code
= #{bizOrgCode}
</if>
<if
test=
"bizOrgCode != null and bizOrgCode != '' "
>
AND m.biz_org_code
LIKE concat( #{bizOrgCode}, '%')
</if>
</where>
ORDER BY m.id DESC
<choose>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment