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
23eef1d9
Commit
23eef1d9
authored
Oct 13, 2022
by
wanglong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加设备 管材筛选 项目资源类别枚举判断
parent
06ff998b
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
88 additions
and
16 deletions
+88
-16
ProjectResourceEnum.java
...in/amos/boot/module/ugp/api/Enum/ProjectResourceEnum.java
+48
-0
IWeldService.java
...eejoin/amos/boot/module/ugp/api/service/IWeldService.java
+1
-1
EquipmentController.java
...s/boot/module/ugp/biz/controller/EquipmentController.java
+2
-2
MaterialController.java
...os/boot/module/ugp/biz/controller/MaterialController.java
+2
-2
EquipmentServiceImpl.java
...oot/module/ugp/biz/service/impl/EquipmentServiceImpl.java
+9
-3
MaterialServiceImpl.java
...boot/module/ugp/biz/service/impl/MaterialServiceImpl.java
+8
-2
ProjectResourceServiceImpl.java
...dule/ugp/biz/service/impl/ProjectResourceServiceImpl.java
+15
-2
WeldServiceImpl.java
...mos/boot/module/ugp/biz/service/impl/WeldServiceImpl.java
+3
-4
No files found.
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/ProjectResourceEnum.java
0 → 100644
View file @
23eef1d9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
Enum
;
import
java.util.HashMap
;
import
java.util.Map
;
public
enum
ProjectResourceEnum
{
焊工资源
(
"焊工"
,
"welder"
),
设备资源
(
"设备"
,
"equipment"
),
管材资源
(
"管材"
,
"material"
);
private
String
status
;
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
public
String
getState
()
{
return
state
;
}
public
void
setState
(
String
state
)
{
this
.
state
=
state
;
}
ProjectResourceEnum
(
String
status
,
String
state
)
{
this
.
status
=
status
;
this
.
state
=
state
;
}
private
String
state
;
public
static
final
Map
<
String
,
String
>
map
=
new
HashMap
<>();
static
{
for
(
ProjectResourceEnum
projectResourceEnum:
ProjectResourceEnum
.
values
()){
map
.
put
(
projectResourceEnum
.
status
,
projectResourceEnum
.
state
);
}
}
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/service/IWeldService.java
View file @
23eef1d9
...
@@ -12,5 +12,5 @@ import java.util.List;
...
@@ -12,5 +12,5 @@ import java.util.List;
* @date 2022-09-22
* @date 2022-09-22
*/
*/
public
interface
IWeldService
{
public
interface
IWeldService
{
List
<
Weld
>
getCode
(
Long
projectCode
,
int
number
)
throws
Exception
;
List
<
Weld
>
getCode
(
Long
projectCode
,
int
number
);
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/EquipmentController.java
View file @
23eef1d9
...
@@ -127,7 +127,7 @@ public class EquipmentController extends BaseController {
...
@@ -127,7 +127,7 @@ public class EquipmentController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备数据名称查询"
,
notes
=
"设备数据名称查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备数据名称查询"
,
notes
=
"设备数据名称查询"
)
@GetMapping
(
value
=
"/selectName"
)
@GetMapping
(
value
=
"/selectName"
)
public
ResponseModel
<
List
<
JSONObject
>>
selectName
()
{
public
ResponseModel
<
List
<
JSONObject
>>
selectName
(
@RequestParam
(
value
=
"unitId"
)
String
installationUnitId
)
{
return
ResponseHelper
.
buildResponse
(
equipmentServiceImpl
.
selectName
());
return
ResponseHelper
.
buildResponse
(
equipmentServiceImpl
.
selectName
(
installationUnitId
));
}
}
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/MaterialController.java
View file @
23eef1d9
...
@@ -136,7 +136,7 @@ public class MaterialController extends BaseController {
...
@@ -136,7 +136,7 @@ public class MaterialController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"材料信息表列表全部数据查询"
,
notes
=
"材料信息表列表全部数据查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"材料信息表列表全部数据查询"
,
notes
=
"材料信息表列表全部数据查询"
)
@GetMapping
(
value
=
"/selectName"
)
@GetMapping
(
value
=
"/selectName"
)
public
ResponseModel
<
List
<
JSONObject
>>
selectName
()
{
public
ResponseModel
<
List
<
JSONObject
>>
selectName
(
@RequestParam
(
value
=
"unitId"
)
String
installationUnitId
)
{
return
ResponseHelper
.
buildResponse
(
materialServiceImpl
.
selectName
());
return
ResponseHelper
.
buildResponse
(
materialServiceImpl
.
selectName
(
installationUnitId
));
}
}
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/EquipmentServiceImpl.java
View file @
23eef1d9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Equipment
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Equipment
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.EquipmentMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.EquipmentMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IEquipmentService
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IEquipmentService
;
...
@@ -12,6 +13,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...
@@ -12,6 +13,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
/**
* 设备信息表服务实现类
* 设备信息表服务实现类
...
@@ -43,10 +45,14 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E
...
@@ -43,10 +45,14 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E
*
*
* @return
* @return
*/
*/
public
List
<
JSONObject
>
selectName
()
{
public
List
<
JSONObject
>
selectName
(
String
installationUnitId
)
{
List
<
JSONObject
>
names
=
new
ArrayList
<>();
List
<
JSONObject
>
names
=
new
ArrayList
<>();
//查询所有设备数据
//添加查询条件
List
<
Equipment
>
equipment
=
equipmentMapper
.
selectList
(
null
);
QueryWrapper
<
Equipment
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"company_id"
,
installationUnitId
);
List
<
Equipment
>
equipment
=
equipmentMapper
.
selectList
(
wrapper
);
for
(
Equipment
i
:
equipment
)
{
for
(
Equipment
i
:
equipment
)
{
JSONObject
name
=
new
JSONObject
();
JSONObject
name
=
new
JSONObject
();
name
.
put
(
"name"
,
i
.
getName
());
name
.
put
(
"name"
,
i
.
getName
());
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/MaterialServiceImpl.java
View file @
23eef1d9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.MaterialDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.MaterialDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Equipment
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Material
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Material
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.MaterialMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.MaterialMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IMaterialService
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IMaterialService
;
...
@@ -38,10 +40,14 @@ public class MaterialServiceImpl extends BaseService<MaterialDto, Material, Mate
...
@@ -38,10 +40,14 @@ public class MaterialServiceImpl extends BaseService<MaterialDto, Material, Mate
/**
/**
* 获取材料名称跟企业id
* 获取材料名称跟企业id
*/
*/
public
List
<
JSONObject
>
selectName
()
{
public
List
<
JSONObject
>
selectName
(
String
installationUnitId
)
{
List
<
JSONObject
>
names
=
new
ArrayList
<>();
List
<
JSONObject
>
names
=
new
ArrayList
<>();
//添加查询条件
QueryWrapper
<
Material
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"company_id"
,
installationUnitId
);
List
<
Material
>
materials
=
baseMapper
.
selectList
(
wrapper
);
List
<
Material
>
materials
=
baseMapper
.
selectList
(
null
);
for
(
Material
i
:
materials
)
{
for
(
Material
i
:
materials
)
{
JSONObject
name
=
new
JSONObject
();
JSONObject
name
=
new
JSONObject
();
name
.
put
(
"name"
,
i
.
getName
());
name
.
put
(
"name"
,
i
.
getName
());
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/ProjectResourceServiceImpl.java
View file @
23eef1d9
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectResourceEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.ProjectResource
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.ProjectResource
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.EquipmentMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.EquipmentMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectResourceMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectResourceMapper
;
...
@@ -13,7 +14,11 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
...
@@ -13,7 +14,11 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
Enum
.
ProjectResourceEnum
.*;
/**
/**
* 项目资源表(包括焊工、管材、设备)服务实现类
* 项目资源表(包括焊工、管材、设备)服务实现类
...
@@ -53,11 +58,19 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,
...
@@ -53,11 +58,19 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,
for
(
Object
json2
:
subForm
)
{
for
(
Object
json2
:
subForm
)
{
String
select
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
json2
)).
getString
(
"select"
);
String
select
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
json2
)).
getString
(
"select"
);
String
type
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
json2
)).
getString
(
"type"
);
String
companyId
=
jsonObject
.
getString
(
"company_id"
);
String
companyId
=
jsonObject
.
getString
(
"company_id"
);
String
type
=
jsonObject
.
getString
(
"type"
);
if
(
type
.
equals
(
设备资源
.
getStatus
()))
{
projectResource
.
setType
(
设备资源
.
getState
());
}
if
(
type
.
equals
(
焊工资源
.
getStatus
()))
{
projectResource
.
setType
(
焊工资源
.
getState
());
}
if
(
type
.
equals
(
管材资源
.
getStatus
()))
{
projectResource
.
setType
(
管材资源
.
getState
());
}
projectResource
.
setProjectId
(
Long
.
valueOf
(
companyId
));
projectResource
.
setProjectId
(
Long
.
valueOf
(
companyId
));
projectResource
.
setResourceId
(
Long
.
valueOf
(
select
));
projectResource
.
setResourceId
(
Long
.
valueOf
(
select
));
projectResource
.
setType
(
type
);
this
.
save
(
projectResource
);
this
.
save
(
projectResource
);
}
}
...
...
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 @
23eef1d9
...
@@ -65,13 +65,12 @@ class WeldServiceImpl extends BaseService<WeldDto, Weld, WeldMapper> implements
...
@@ -65,13 +65,12 @@ class WeldServiceImpl extends BaseService<WeldDto, Weld, WeldMapper> implements
}
}
}
}
if
(
projectId
==
null
)
{
//如果不为空则过滤
return
weldDtoPage
;
if
(
projectId
!=
null
)
{
}
else
{
List
<
WeldDto
>
L
=
weldDtoPage
.
getRecords
().
stream
().
filter
(
b
->
b
.
getProjectId
().
equals
(
projectId
)).
collect
(
Collectors
.
toList
());
List
<
WeldDto
>
L
=
weldDtoPage
.
getRecords
().
stream
().
filter
(
b
->
b
.
getProjectId
().
equals
(
projectId
)).
collect
(
Collectors
.
toList
());
weldDtoPage
.
setRecords
(
L
);
weldDtoPage
.
setRecords
(
L
);
return
weldDtoPage
;
}
}
return
weldDtoPage
;
}
}
...
...
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