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
be4daecb
Commit
be4daecb
authored
Nov 14, 2022
by
wanglong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加基础信息删除判断 添加基础项目设备的状态更改
parent
080b68b5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
39 deletions
+70
-39
MaterialController.java
...os/boot/module/ugp/biz/controller/MaterialController.java
+8
-6
ProjectResourceController.java
.../module/ugp/biz/controller/ProjectResourceController.java
+6
-2
WelderController.java
...amos/boot/module/ugp/biz/controller/WelderController.java
+13
-2
ProjectResourceServiceImpl.java
...dule/ugp/biz/service/impl/ProjectResourceServiceImpl.java
+43
-29
No files found.
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/MaterialController.java
View file @
be4daecb
...
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.ugp.biz.controller;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.ProjectResource
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.AttachmentMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectResourceMapper
;
...
...
@@ -86,16 +87,17 @@ public class MaterialController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@DeleteMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除材料信息表"
,
notes
=
"根据sequenceNbr删除材料信息表"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
List
<
Long
>
sequenceNbr
)
throws
Exception
{
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
List
<
Long
>
sequenceNbr
)
throws
Exception
{
LambdaQueryWrapper
<
ProjectResource
>
wrapper
=
new
LambdaQueryWrapper
<>();
for
(
Long
i:
sequenceNbr
){
wrapper
.
eq
(
ProjectResource:
:
getResourceId
,
i
);
if
(!
projectResourceMapper
.
selectList
(
wrapper
).
isEmpty
()){
throw
new
Exception
(
"无法删除,已绑定项目"
);
for
(
Long
i
:
sequenceNbr
)
{
wrapper
.
eq
(
ProjectResource:
:
getResourceId
,
i
);
if
(!
projectResourceMapper
.
selectList
(
wrapper
).
isEmpty
())
{
return
CommonResponseUtil
.
failure
(
"无法删除,管材:"
+
materialServiceImpl
.
getById
(
i
).
getName
()
+
"已绑定项目"
);
}
}
return
ResponseHelper
.
buildResponse
(
materialServiceImpl
.
removeByIds
(
sequenceNbr
));
return
ResponseHelper
.
buildResponse
(
materialServiceImpl
.
removeByIds
(
sequenceNbr
));
}
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/ProjectResourceController.java
View file @
be4daecb
...
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.ugp.biz.controller;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProjectMaterialDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto
;
import
com.alibaba.fastjson.JSONObject
;
...
...
@@ -12,6 +13,7 @@ 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.ProjectResourceMapper
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.MaterialServiceImpl
;
import
org.aspectj.bridge.Message
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
...
...
@@ -203,8 +205,10 @@ public class ProjectResourceController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"绑定项目所用到的设备管材"
,
notes
=
"绑定项目所用到的设备管材"
)
@PostMapping
(
value
=
"/saveId"
)
public
ResponseModel
<
ProjectResource
>
saveId
(
@RequestBody
JSONObject
jsonObject
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
projectResourceServiceImpl
.
saveIds
(
jsonObject
));
public
ResponseModel
<
ResponseModel
>
saveId
(
@RequestBody
JSONObject
jsonObject
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
projectResourceServiceImpl
.
saveIds
(
jsonObject
));
}
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/WelderController.java
View file @
be4daecb
...
...
@@ -8,12 +8,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.UserDto
;
import
com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WelderDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Project
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.ProjectResource
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectResourceMapper
;
import
com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify
;
...
...
@@ -176,9 +178,18 @@ public class WelderController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@DeleteMapping
(
value
=
"/deleteOneById/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr删除人员信息表"
,
notes
=
"根据sequenceNbr删除人员信息表"
)
public
ResponseModel
<
String
>
deleteOneById
(
@PathVariable
String
sequenceNbr
)
throws
Exception
{
public
ResponseModel
<
String
>
deleteOneById
(
@PathVariable
List
<
Long
>
sequenceNbr
)
throws
Exception
{
// Privilege.agencyUserClient.multDeleteUser(orgServiceImpl.getOrgUsrById(sequenceNbr).getAmosOrgId());
orgServiceImpl
.
delectInfo
(
sequenceNbr
);
LambdaQueryWrapper
<
ProjectResource
>
wrapper
=
new
LambdaQueryWrapper
<>();
for
(
Long
i
:
sequenceNbr
)
{
wrapper
.
eq
(
ProjectResource:
:
getResourceId
,
i
);
if
(!
projectResourceMapper
.
selectList
(
wrapper
).
isEmpty
())
{
return
CommonResponseUtil
.
failure
(
"无法删除,管材:"
+
orgServiceImpl
.
getdetialInfo
(
String
.
valueOf
(
i
)).
get
(
"name"
)
+
"已绑定项目"
);
}
orgServiceImpl
.
delectInfo
(
String
.
valueOf
(
i
));
}
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
...
...
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 @
be4daecb
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.core.metadata.IPage
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectResourceEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.
ProjectMaterial
Dto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.
Welder
Dto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.*
;
import
com.alibaba.fastjson.JSON
;
...
...
@@ -16,9 +18,11 @@ import com.alibaba.fastjson.JSONObject;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.EquipmentMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.MaterialMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectResourceMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.WeldMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IProjectResourceService
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProjectResourceDto
;
import
com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify
;
import
org.apache.ibatis.annotations.Case
;
import
org.aspectj.weaver.ast.Test
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -28,6 +32,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.*
;
...
...
@@ -136,7 +141,7 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,P
/**
* 绑定项目所用到的设备管材
*/
public
ProjectResource
saveIds
(
JSONObject
jsonObject
)
throws
Exception
{
public
ResponseModel
saveIds
(
JSONObject
jsonObject
)
throws
Exception
{
JSONArray
subForm
=
jsonObject
.
getJSONArray
(
"subForm"
);
ProjectResource
Resource
=
new
ProjectResource
();
...
...
@@ -148,36 +153,45 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,P
Long
SequenceNbr
=
Long
.
valueOf
(
jsonObject
.
getString
(
"sequenceNbr"
));
String
type
=
jsonObject
.
getString
(
"type"
);
LambdaQueryWrapper
<
ProjectResource
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
ProjectResource:
:
getResourceId
,
select
);
wrapper
.
eq
(
ProjectResource:
:
getProjectId
,
SequenceNbr
);
wrapper
.
eq
(
ProjectResource:
:
getResourceId
,
select
);
wrapper
.
eq
(
ProjectResource:
:
getProjectId
,
SequenceNbr
);
ProjectResource
projectResourceVerify
=
projectResourceMapper
.
selectOne
(
wrapper
);
if
(
ValidationUtil
.
isEmpty
(
projectResourceVerify
)){
//判断资源类型并插入
if
(
type
.
equals
(
设备资源
.
getName
()))
{
projectResource
.
setType
(
设备资源
.
getCode
());
Equipment
equipment
=
equipmentMapper
.
selectById
(
select
);
projectResource
.
setName
(
equipment
.
getName
());
}
if
(
type
.
equals
(
焊工资源
.
getName
()))
{
projectResource
.
setType
(
焊工资源
.
getCode
());
OrgUsr
orgUsrById
=
orgService
.
getOrgUsrById
(
select
);
projectResource
.
setName
(
orgUsrById
.
getBizOrgName
());
}
if
(
type
.
equals
(
管材资源
.
getName
()))
{
projectResource
.
setType
(
管材资源
.
getCode
());
Material
material
=
materialMapper
.
selectById
(
select
);
projectResource
.
setName
(
material
.
getName
());
}
projectResource
.
setProjectId
(
SequenceNbr
);
projectResource
.
setResourceId
(
Long
.
valueOf
(
select
));
BeanUtils
.
copyProperties
(
projectResource
,
Resource
);
this
.
save
(
projectResource
);
}
else
{
throw
new
Exception
(
"该资源已存在"
);
if
(
ValidationUtil
.
isEmpty
(
projectResourceVerify
))
{
//判断资源类型并插入
if
(
type
.
equals
(
设备资源
.
getName
()))
{
projectResource
.
setType
(
设备资源
.
getCode
());
Equipment
equipment
=
equipmentMapper
.
selectById
(
select
);
projectResource
.
setName
(
equipment
.
getName
());
}
if
(
type
.
equals
(
焊工资源
.
getName
()))
{
projectResource
.
setType
(
焊工资源
.
getCode
());
OrgUsr
orgUsrById
=
orgService
.
getOrgUsrById
(
select
);
projectResource
.
setName
(
orgUsrById
.
getBizOrgName
());
}
if
(
type
.
equals
(
管材资源
.
getName
()))
{
projectResource
.
setType
(
管材资源
.
getCode
());
Material
material
=
materialMapper
.
selectById
(
select
);
projectResource
.
setName
(
material
.
getName
());
}
projectResource
.
setProjectId
(
SequenceNbr
);
projectResource
.
setResourceId
(
Long
.
valueOf
(
select
));
BeanUtils
.
copyProperties
(
projectResource
,
Resource
);
boolean
save
=
this
.
save
(
projectResource
);
if
(
save
||
type
.
equals
(
设备资源
.
getName
()))
{
LambdaQueryWrapper
<
Equipment
>
wrapperEquipment
=
new
LambdaQueryWrapper
<>();
wrapperEquipment
.
eq
(
BaseEntity:
:
getSequenceNbr
,
select
);
Equipment
equipment
=
new
Equipment
();
equipment
.
setUseStatus
(
"已使用"
);
equipmentMapper
.
update
(
equipment
,
wrapperEquipment
);
}
}
else
{
// throw new Exception("该资源已存在");
return
CommonResponseUtil
.
failure
(
"该资源已存在"
);
}
}
return
Resource
;
return
CommonResponseUtil
.
success
()
;
}
...
...
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