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
9faa82a6
Commit
9faa82a6
authored
Oct 17, 2022
by
wanglong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加焊口编码条件筛选
parent
da1e0ec0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
7 deletions
+63
-7
WeldController.java
...n/amos/boot/module/ugp/biz/controller/WeldController.java
+14
-2
WeldServiceImpl.java
...mos/boot/module/ugp/biz/service/impl/WeldServiceImpl.java
+49
-5
No files found.
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/WeldController.java
View file @
9faa82a6
...
...
@@ -101,9 +101,21 @@ public class WeldController extends BaseController {
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"焊口信息表分页查询"
,
notes
=
"焊口信息表分页查询"
)
public
ResponseModel
<
Page
<
WeldDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
String
projectId
)
{
(
value
=
"size"
)
int
size
)
{
return
ResponseHelper
.
buildResponse
(
weldServiceImpl
.
queryForWeldPage
(
current
,
size
,
projectId
));
return
ResponseHelper
.
buildResponse
(
weldServiceImpl
.
queryForWeldPage
(
current
,
size
));
}
/**
* 更新焊口编码任务状态
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/updateTask"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"更新焊口编码任务状态"
,
notes
=
"更新焊口编码任务状态"
)
public
ResponseModel
<
String
>
updateTask
(
Weld
weld
)
{
return
ResponseHelper
.
buildResponse
(
weldServiceImpl
.
updateTask
(
weld
));
}
/**
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/WeldServiceImpl.java
View file @
9faa82a6
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.WeldCodeEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.WeldMethodEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WeldDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Project
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.SuperviseRule
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Weld
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.SuperviseRuleMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.WeldMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IWeldService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.stream.Collectors
;
...
...
@@ -34,15 +40,22 @@ class WeldServiceImpl extends BaseService<WeldDto, Weld, WeldMapper> implements
WeldMapper
weldMapper
;
@Autowired
ProjectMapper
projectMapper
;
@Autowired
OrgServiceImpl
orgService
;
@Autowired
SuperviseRuleMapper
superviseRuleMapper
;
// Logger logger = LoggerFactory.getLogger(WeldServiceImpl.class);
private
final
String
安装单位
=
"INSTALL"
;
private
final
String
监察单位
=
"SUPERVISION"
;
/**
* 分页查询
* 分页查询(安装单位管理员只能查看本单位项目所有焊口信息。
* 监检机构管理员可查看所有项目焊口信息。)
*/
public
Page
<
WeldDto
>
queryForWeldPage
(
int
current
,
int
size
,
String
projectId
)
{
public
Page
<
WeldDto
>
queryForWeldPage
(
int
current
,
int
size
)
{
Page
<
WeldDto
>
page
=
new
Page
<>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
...
...
@@ -65,15 +78,46 @@ class WeldServiceImpl extends BaseService<WeldDto, Weld, WeldMapper> implements
}
}
//如果不为空则过滤
if
(
projectId
!=
null
)
{
List
<
WeldDto
>
L
=
weldDtoPage
.
getRecords
().
stream
().
filter
(
b
->
b
.
getProjectId
().
equals
(
projectId
)).
collect
(
Collectors
.
toList
());
//获取登录人信息
OrgUsr
orgUsr
=
orgService
.
getOrgUsr
();
//获取登录人企业下的所有焊口
if
(
orgUsr
.
getOrgExpandAttr1
()
==
安装单位
)
{
List
<
WeldDto
>
L
=
weldDtoPage
.
getRecords
().
stream
().
filter
(
b
->
b
.
getInstallCompany
().
equals
(
orgUsr
.
getParentId
())).
collect
(
Collectors
.
toList
());
weldDtoPage
.
setRecords
(
L
);
}
//根据 所在地 筛选焊口
if
(
orgUsr
.
getOrgExpandAttr1
()
==
监察单位
)
{
LambdaQueryWrapper
<
SuperviseRule
>
wrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
SuperviseRule
>
eq
=
wrapper
.
eq
(
SuperviseRule:
:
getSuperviseDeptId
,
orgUsr
.
getParentId
());
List
<
SuperviseRule
>
superviseRules
=
superviseRuleMapper
.
selectList
(
eq
);
for
(
SuperviseRule
i
:
superviseRules
)
{
List
<
WeldDto
>
L
=
weldDtoPage
.
getRecords
().
stream
().
filter
(
b
->
b
.
getRegion
().
equals
(
i
.
getAdminRegion
())).
collect
(
Collectors
.
toList
());
weldDtoPage
.
setRecords
(
L
);
}
}
return
weldDtoPage
;
}
/**
* 更新焊口编码任务状态
*/
public
String
updateTask
(
Weld
weld
)
{
LambdaQueryWrapper
<
Weld
>
wrapper
=
new
LambdaQueryWrapper
<>();
//根据焊口编码修改任务状态
wrapper
.
eq
(
Weld:
:
getCode
,
weld
.
getCode
());
int
update
=
weldMapper
.
update
(
weld
,
wrapper
);
return
"成功更新"
+
update
+
"条"
;
}
/**
* 列表查询 示例
*/
...
...
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