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
45f1a14d
Commit
45f1a14d
authored
Sep 27, 2021
by
chenhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://172.16.10.76/moa/amos-boot-biz
into developer
parents
d70ed6f9
6dc4c21a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
16 deletions
+19
-16
PersonIdentifyAspect.java
...amos/maintenance/core/framework/PersonIdentifyAspect.java
+2
-2
HiddenDangerController.java
...pervision/business/controller/HiddenDangerController.java
+3
-1
HiddenDangerServiceImpl.java
...vision/business/service/impl/HiddenDangerServiceImpl.java
+4
-3
IHiddenDangerService.java
...ervision/business/service/intfc/IHiddenDangerService.java
+3
-1
PersonIdentify.java
...ejoin/amos/supervision/core/framework/PersonIdentify.java
+1
-1
PersonIdentifyAspect.java
...amos/supervision/core/framework/PersonIdentifyAspect.java
+6
-8
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/core/framework/PersonIdentifyAspect.java
View file @
45f1a14d
...
...
@@ -14,6 +14,7 @@ import org.aspectj.lang.annotation.Aspect;
import
org.aspectj.lang.annotation.Before
;
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
;
...
...
@@ -36,7 +37,6 @@ public class PersonIdentifyAspect {
@Autowired
JCSFeignClient
jcsFeignClient
;
final
int
HTTP_OK_STATUS
=
200
;
@Before
(
value
=
"@annotation(com.yeejoin.amos.maintenance.core.framework.PersonIdentify) && @annotation(permission)"
)
public
void
personIdentity
(
JoinPoint
joinPoint
,
PersonIdentify
permission
)
throws
PermissionException
{
...
...
@@ -45,7 +45,7 @@ public class PersonIdentifyAspect {
//调用jcs,进行人员身份判断,是维保公司人员还是业主单位人员
String
userId
=
reginParam
.
getUserModel
().
getUserId
();
FeignClientResult
responseModel
=
jcsFeignClient
.
getUserUnit
(
userId
);
if
(
ObjectUtils
.
isEmpty
(
responseModel
.
getResult
())
||
responseModel
.
getStatus
()
!=
H
TTP_OK_STATUS
)
{
if
(
ObjectUtils
.
isEmpty
(
responseModel
.
getResult
())
||
responseModel
.
getStatus
()
!=
H
ttpStatus
.
OK
.
value
()
)
{
throw
new
RuntimeException
(
responseModel
.
getDevMessage
());
}
ReginParams
.
PersonIdentity
personIdentity
=
(
ReginParams
.
PersonIdentity
)
Bean
.
mapToBean
((
Map
<
String
,
Object
>)
responseModel
.
getResult
(),
ReginParams
.
PersonIdentity
.
class
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/controller/HiddenDangerController.java
View file @
45f1a14d
...
...
@@ -6,6 +6,7 @@ import com.yeejoin.amos.supervision.business.dto.HiddenDangerImportDto;
import
com.yeejoin.amos.supervision.business.service.intfc.IHiddenDangerService
;
import
com.yeejoin.amos.supervision.business.util.FileHelper
;
import
com.yeejoin.amos.supervision.core.common.dto.DangerDto
;
import
com.yeejoin.amos.supervision.core.framework.PersonIdentify
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
...
...
@@ -79,13 +80,14 @@ public class HiddenDangerController extends AbstractBaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PersonIdentify
@ApiOperation
(
value
=
"导入隐患"
,
notes
=
"导入隐患"
)
@RequestMapping
(
value
=
"/import"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
ResponseModel
importDanger
(
@RequestParam
(
value
=
"planId"
)
Long
planId
,
@ApiParam
(
value
=
"导入数据文件"
,
required
=
true
)
@RequestBody
MultipartFile
file
)
{
List
<
HiddenDangerImportDto
>
list
=
FileHelper
.
importExcel
(
file
,
0
,
1
,
HiddenDangerImportDto
.
class
);
iHiddenDangerService
.
importDanger
(
planId
,
list
);
iHiddenDangerService
.
importDanger
(
getSelectedOrgInfo
(),
planId
,
list
);
return
ResponseHelper
.
buildResponse
(
"导入成功"
);
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/service/impl/HiddenDangerServiceImpl.java
View file @
45f1a14d
...
...
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.toolkit.Sequence;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.google.common.base.Joiner
;
import
com.google.common.collect.Lists
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.excel.DataSources
;
import
com.yeejoin.amos.boot.biz.common.excel.ExcelUtil
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
...
...
@@ -22,7 +23,6 @@ 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
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.restful.exception.instance.DataNotFound
;
...
...
@@ -142,8 +142,9 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService {
}
@Override
public
void
importDanger
(
Long
planId
,
List
<
HiddenDangerImportDto
>
list
)
{
public
void
importDanger
(
ReginParams
reginParams
,
Long
planId
,
List
<
HiddenDangerImportDto
>
list
)
{
//1.调用创建隐患
ReginParams
.
PersonIdentity
personIdentity
=
reginParams
.
getPersonIdentity
();
List
<
DangerDto
>
dtoList
=
list
.
stream
().
map
(
s
->
{
String
[]
dangerArray
=
s
.
getDangerLevelName
().
split
(
"@"
);
String
[]
reformTypeArray
=
s
.
getReformTypeName
().
split
(
"@"
);
...
...
@@ -164,7 +165,7 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService {
//2.保存隐患关系表
List
<
HiddenDanger
>
hiddenDangers
=
dangerDbs
.
stream
().
map
(
d
->
{
HiddenDanger
hiddenDanger
=
new
HiddenDanger
();
hiddenDanger
.
setCreateBy
(
RequestContext
.
getExeUserId
());
hiddenDanger
.
setCreateBy
(
personIdentity
.
getPersonSeq
());
hiddenDanger
.
setPlanId
(
planId
);
hiddenDanger
.
setLatentDangerId
(
d
.
getId
());
hiddenDanger
.
setCheckInputId
(
d
.
getBizId
());
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/service/intfc/IHiddenDangerService.java
View file @
45f1a14d
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.supervision.business.service.intfc;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.supervision.business.dto.HiddenDangerExportDataDto
;
import
com.yeejoin.amos.supervision.business.dto.HiddenDangerImportDto
;
import
com.yeejoin.amos.supervision.core.common.dto.DangerDto
;
...
...
@@ -56,10 +57,11 @@ public interface IHiddenDangerService {
/**
* 导入
* @param selectedOrgInfo 用户信息
* @param planId 计划id
* @param list 数据
*/
void
importDanger
(
Long
planId
,
List
<
HiddenDangerImportDto
>
list
);
void
importDanger
(
ReginParams
selectedOrgInfo
,
Long
planId
,
List
<
HiddenDangerImportDto
>
list
);
/**
* 下载模板
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/core/framework/PersonIdentify.java
View file @
45f1a14d
...
...
@@ -11,7 +11,7 @@ import java.lang.annotation.*;
public
@interface
PersonIdentify
{
/**
* 是否进行人员校验
* @return
* @return
boolean
*/
boolean
isNeedIdentity
()
default
true
;
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/core/framework/PersonIdentifyAspect.java
View file @
45f1a14d
...
...
@@ -14,11 +14,11 @@ import org.aspectj.lang.annotation.Aspect;
import
org.aspectj.lang.annotation.Before
;
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.List
;
import
java.util.Map
;
...
...
@@ -37,8 +37,6 @@ public class PersonIdentifyAspect {
@Autowired
JCSFeignClient
jcsFeignClient
;
final
int
HTTP_OK_STATUS
=
200
;
@Before
(
value
=
"@annotation(com.yeejoin.amos.supervision.core.framework.PersonIdentify) && @annotation(permission)"
)
public
void
personIdentity
(
JoinPoint
joinPoint
,
PersonIdentify
permission
)
throws
PermissionException
{
ReginParams
reginParam
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
...
...
@@ -46,15 +44,15 @@ public class PersonIdentifyAspect {
//调用jcs,进行人员身份判断,是维保公司人员还是业主单位人员
String
userId
=
reginParam
.
getUserModel
().
getUserId
();
FeignClientResult
responseModel
=
jcsFeignClient
.
getUserUnit
(
userId
);
if
(
ObjectUtils
.
isEmpty
(
responseModel
.
getResult
())
||
responseModel
.
getStatus
()
!=
H
TTP_OK_STATUS
)
{
if
(
ObjectUtils
.
isEmpty
(
responseModel
.
getResult
())
||
responseModel
.
getStatus
()
!=
H
ttpStatus
.
OK
.
value
()
)
{
throw
new
RuntimeException
(
responseModel
.
getDevMessage
());
}
List
result
=
(
List
)
responseModel
.
getResult
();
List
result
=
(
List
)
responseModel
.
getResult
();
ReginParams
.
PersonIdentity
personIdentity
=
new
ReginParams
.
PersonIdentity
();
if
(!
ObjectUtils
.
isEmpty
(
result
))
{
Map
map
=
(
Map
)
result
.
get
(
0
);
Map
other
=
(
Map
)
map
.
get
(
"DEPARTMENT"
);
Map
person
=
(
Map
)
map
.
get
(
"PERSON"
);
Map
map
=
(
Map
)
result
.
get
(
0
);
Map
other
=
(
Map
)
map
.
get
(
"DEPARTMENT"
);
Map
person
=
(
Map
)
map
.
get
(
"PERSON"
);
if
(!
ObjectUtils
.
isEmpty
(
person
))
{
personIdentity
.
setPersonSeq
((
String
)
person
.
get
(
"sequenceNbr"
));
personIdentity
.
setPersonName
((
String
)
person
.
get
(
"recUserName"
));
...
...
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