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
7c5bb785
Commit
7c5bb785
authored
Oct 13, 2022
by
srx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备管理:筛选,新增,修改,删除,详情
parent
d0d167d7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
89 additions
and
4 deletions
+89
-4
AttachmentMapper.java
...oin/amos/boot/module/ugp/api/mapper/AttachmentMapper.java
+6
-0
IEquipmentService.java
...n/amos/boot/module/ugp/api/service/IEquipmentService.java
+10
-0
AttachmentMapper.xml
...le-ugp-api/src/main/resources/mapper/AttachmentMapper.xml
+10
-0
EquipmentController.java
...s/boot/module/ugp/biz/controller/EquipmentController.java
+0
-0
EquipmentServiceImpl.java
...oot/module/ugp/biz/service/impl/EquipmentServiceImpl.java
+63
-4
No files found.
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/mapper/AttachmentMapper.java
View file @
7c5bb785
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
mapper
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
mapper
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.AttachmentDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Attachment
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Attachment
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
...
@@ -11,4 +12,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...
@@ -11,4 +12,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
*/
public
interface
AttachmentMapper
extends
BaseMapper
<
Attachment
>
{
public
interface
AttachmentMapper
extends
BaseMapper
<
Attachment
>
{
//根据source_id删除附件
void
deleteBySourceId
(
Long
sourceId
);
//根据source_id查询附件
AttachmentDto
selectAttBySeq
(
Long
sourceId
);
}
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/service/IEquipmentService.java
View file @
7c5bb785
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
service
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
service
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
/**
* 设备信息表接口类
* 设备信息表接口类
*
*
...
@@ -8,5 +15,8 @@ package com.yeejoin.amos.boot.module.ugp.api.service;
...
@@ -8,5 +15,8 @@ package com.yeejoin.amos.boot.module.ugp.api.service;
* @date 2022-09-22
* @date 2022-09-22
*/
*/
public
interface
IEquipmentService
{
public
interface
IEquipmentService
{
//添加设备+附件
EquipmentDto
saveEI
(
JSONObject
object
);
}
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/resources/mapper/AttachmentMapper.xml
View file @
7c5bb785
...
@@ -2,4 +2,14 @@
...
@@ -2,4 +2,14 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.ugp.api.mapper.AttachmentMapper"
>
<mapper
namespace=
"com.yeejoin.amos.boot.module.ugp.api.mapper.AttachmentMapper"
>
<!-- //根据source_id删除附件-->
<delete
id=
"deleteBySourceId"
>
delete FROM tz_ugp_attachment where source_id=#{sourceId}
</delete>
<!-- //根据source_id查询附件-->
<select
id=
"selectAttBySeq"
resultType=
"com.yeejoin.amos.boot.module.ugp.api.dto.AttachmentDto"
>
select * from tz_ugp_attachment where source_id=#{sourceId}
</select>
</mapper>
</mapper>
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/EquipmentController.java
View file @
7c5bb785
This diff is collapsed.
Click to expand it.
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 @
7c5bb785
...
@@ -2,11 +2,17 @@ package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
...
@@ -2,11 +2,17 @@ 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.core.conditions.query.QueryWrapper
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.AttachmentDto
;
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
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Repository
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
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
;
...
@@ -26,18 +32,24 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E
...
@@ -26,18 +32,24 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E
@Autowired
@Autowired
EquipmentMapper
equipmentMapper
;
EquipmentMapper
equipmentMapper
;
@Autowired
AttachmentServiceImpl
attachmentServiceImpl
;
/**
/**
* 分页查询
* 分页查询
*/
*/
public
Page
<
EquipmentDto
>
queryForEquipmentPage
(
Page
<
EquipmentDto
>
page
)
{
public
Page
<
EquipmentDto
>
queryForEquipmentPage
(
Page
<
EquipmentDto
>
page
,
String
name
,
String
code
,
String
verifyStatus
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
return
this
.
queryForPage
(
page
,
null
,
false
,
name
,
code
,
verifyStatus
);
}
}
/**
/**
* 列表查询 示例
* 列表查询 示例
*/
*/
public
List
<
EquipmentDto
>
queryForEquipmentList
()
{
public
List
<
EquipmentDto
>
queryForEquipmentList
()
{
return
this
.
queryForList
(
""
,
false
);
return
this
.
queryForList
(
""
,
false
);
}
}
/**
/**
...
@@ -62,4 +74,50 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E
...
@@ -62,4 +74,50 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E
return
names
;
return
names
;
}
}
/**
* 根据sourceId添加附件
* @param object
*/
public
void
saveAttachment
(
JSONObject
object
,
Long
SequenceNbr
){
AttachmentDto
attachmentDto
=
new
AttachmentDto
();
JSONArray
subForm
=
object
.
getJSONArray
(
"subForm"
);
for
(
Object
o:
subForm
){
JSONObject
jsonObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
o
));
jsonObject
.
getString
(
"Symbol_key"
);
JSONArray
jsonArray
=
jsonObject
.
getJSONArray
(
"info"
);
for
(
Object
j:
jsonArray
){
JSONObject
info
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
j
));
String
name
=
info
.
getString
(
"name"
);
attachmentDto
.
setSourceId
(
SequenceNbr
);
attachmentDto
.
setName
(
info
.
getString
(
"name"
));
// attachmentDto.setInfo("name: "+name+","+
// "type: "+name.substring(name.lastIndexOf(".")+1)+","+
// "path: "+info.getString("url")+","+
// "certCode: "+jsonObject.getString("certCode")+","+
// "certType: "+jsonObject.getString("certType"));
attachmentDto
.
setInfo
(
JSON
.
toJSONString
(
subForm
));
attachmentDto
.
setType
(
name
.
substring
(
name
.
lastIndexOf
(
"."
)+
1
));
attachmentServiceImpl
.
createWithModel
(
attachmentDto
);
break
;
}
}
}
@Override
public
EquipmentDto
saveEI
(
JSONObject
object
)
{
EquipmentDto
model
=
new
EquipmentDto
();
model
.
setName
(
object
.
getString
(
"name"
));
model
.
setType
(
object
.
getString
(
"type"
));
model
.
setCode
(
object
.
getString
(
"code"
));
model
.
setManufacturer
(
object
.
getString
(
"manufacturer"
));
model
.
setManufactureDate
(
object
.
getDate
(
"manufactureDate"
));
model
.
setServiceLife
(
object
.
getString
(
"serviceLife"
));
model
.
setInspectionDate
(
object
.
getDate
(
"inspectionDate"
));
model
.
setUseStatus
(
object
.
getString
(
"useStatus"
));
model
.
setVerifyStatus
(
object
.
getString
(
"verifyStatus"
));
EquipmentDto
result
=
this
.
createWithModel
(
model
);
return
result
;
}
}
}
\ No newline at end of file
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