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
9606e2b4
Commit
9606e2b4
authored
Nov 22, 2022
by
wl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
图纸管理上传保存 查找
parent
087cebbd
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
402 additions
and
0 deletions
+402
-0
TdcDrawingDto.java
...m/yeejoin/amos/boot/module/tdc/api/dto/TdcDrawingDto.java
+78
-0
TdcDrawing.java
...m/yeejoin/amos/boot/module/tdc/api/entity/TdcDrawing.java
+61
-0
TdcDrawingMapper.java
...oin/amos/boot/module/tdc/api/mapper/TdcDrawingMapper.java
+17
-0
ITdcDrawingService.java
.../amos/boot/module/tdc/api/service/ITdcDrawingService.java
+19
-0
TdcDrawingController.java
.../boot/module/tdc/biz/controller/TdcDrawingController.java
+162
-0
TdcDrawingServiceImpl.java
...ot/module/tdc/biz/service/impl/TdcDrawingServiceImpl.java
+65
-0
No files found.
amos-boot-system-tdc/amos-boot-module-tdc-api/src/main/java/com/yeejoin/amos/boot/module/tdc/api/dto/TdcDrawingDto.java
0 → 100644
View file @
9606e2b4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tdc
.
api
.
dto
;
import
java.util.Date
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.time.LocalDateTime
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* Dto
*
* @author duanwei
* @date 2022-11-22
*/
@Data
@ApiModel
(
value
=
"TdcDrawingDto"
,
description
=
""
)
public
class
TdcDrawingDto
{
private
static
final
long
serialVersionUID
=
1L
;
/**
*
*/
private
Long
sequenceNbr
;
/**
*
*/
private
String
record
;
/**
*
*/
private
LocalDateTime
recDate
;
/**
*
*/
private
String
recUserId
;
/**
*
*/
private
String
instanceId
;
@ApiModelProperty
(
value
=
"图纸名称"
)
/**
* 图纸名称
*/
private
String
drawingName
;
@ApiModelProperty
(
value
=
"图纸地址"
)
/**
* 图纸地址
*/
private
String
drawingUrl
;
@ApiModelProperty
(
value
=
"上传人姓名"
)
/**
* 上传人姓名
*/
private
String
uploadUserName
;
@ApiModelProperty
(
value
=
"上传人单位"
)
/**
* 上传人单位
*/
private
String
uploadCompanyName
;
@ApiModelProperty
(
value
=
"上传人单位code"
)
/**
* 上传人单位code
*/
private
String
uploadCompanyCode
;
@ApiModelProperty
(
value
=
"上传时间"
)
/**
* 上传时间
*/
private
Date
uploadTime
;
}
amos-boot-system-tdc/amos-boot-module-tdc-api/src/main/java/com/yeejoin/amos/boot/module/tdc/api/entity/TdcDrawing.java
0 → 100644
View file @
9606e2b4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tdc
.
api
.
entity
;
import
java.util.Date
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.time.LocalDateTime
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
org.joda.time.DateTime
;
/**
* @author duanwei
* @date 2022-11-22
*/
@Data
@TableName
(
"tdc_drawing"
)
@Accessors
(
chain
=
true
)
@ApiModel
(
value
=
"TdcDrawing对象"
,
description
=
""
)
public
class
TdcDrawing
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"图纸名称"
)
@TableField
(
"DRAWING_NAME"
)
private
String
drawingName
;
@ApiModelProperty
(
value
=
"图纸地址"
)
@TableField
(
"DRAWING_URL"
)
private
String
drawingUrl
;
@ApiModelProperty
(
value
=
"上传人姓名"
)
@TableField
(
"UPLOAD_USER_NAME"
)
private
String
uploadUserName
;
@ApiModelProperty
(
value
=
"上传人单位"
)
@TableField
(
"UPLOAD_COMPANY_NAME"
)
private
String
uploadCompanyName
;
@ApiModelProperty
(
value
=
"上传人单位code"
)
@TableField
(
"UPLOAD_COMPANY_CODE"
)
private
String
uploadCompanyCode
;
@ApiModelProperty
(
value
=
"上传时间"
)
@TableField
(
"UPLOAD_TIME"
)
private
Date
uploadTime
;
}
amos-boot-system-tdc/amos-boot-module-tdc-api/src/main/java/com/yeejoin/amos/boot/module/tdc/api/mapper/TdcDrawingMapper.java
0 → 100644
View file @
9606e2b4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tdc
.
api
.
mapper
;
import
com.yeejoin.amos.boot.module.tdc.api.entity.TdcDrawing
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.mapstruct.Mapper
;
/**
* Mapper 接口
*
* @author duanwei
* @date 2022-11-22
*/
@Mapper
public
interface
TdcDrawingMapper
extends
BaseMapper
<
TdcDrawing
>
{
}
amos-boot-system-tdc/amos-boot-module-tdc-api/src/main/java/com/yeejoin/amos/boot/module/tdc/api/service/ITdcDrawingService.java
0 → 100644
View file @
9606e2b4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tdc
.
api
.
service
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yeejoin.amos.boot.module.tdc.api.entity.TdcDrawing
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Service
;
/**
* 服务类
*
* @author duanwei
* @date 2022-11-22
*/
@Service
public
interface
ITdcDrawingService
extends
IService
<
TdcDrawing
>
{
}
amos-boot-system-tdc/amos-boot-module-tdc-biz/src/main/java/com/yeejoin/amos/boot/module/tdc/biz/controller/TdcDrawingController.java
0 → 100644
View file @
9606e2b4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tdc
.
biz
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
com.yeejoin.amos.boot.module.tdc.api.entity.TdcDrawing
;
import
com.yeejoin.amos.boot.module.tdc.api.service.ITdcDrawingService
;
import
com.yeejoin.amos.boot.module.tdc.biz.service.impl.TdcDrawingServiceImpl
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Arrays
;
import
java.util.List
;
/**
* @author duanwei
* @date 2022-11-22
*/
@RestController
@Api
(
tags
=
"Api"
)
@RequestMapping
(
value
=
"/tdc-drawing"
)
public
class
TdcDrawingController
extends
BaseController
{
@Autowired
ITdcDrawingService
iTdcDrawingService
;
@Autowired
TdcDrawingServiceImpl
iTdcDrawingServiceImpl
;
/**
* 新增
*
* @return
*/
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
public
boolean
saveTdcDrawing
(
HttpServletRequest
request
,
@RequestBody
TdcDrawing
tdcDrawing
)
{
return
iTdcDrawingService
.
save
(
tdcDrawing
);
}
/**
* 根据id删除
*
* @param id
* @return
*/
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
public
boolean
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
{
return
iTdcDrawingService
.
removeById
(
id
);
}
/**
* 修改
*
* @return
*/
@RequestMapping
(
value
=
"/updateById"
,
method
=
RequestMethod
.
PUT
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"修改"
,
notes
=
"修改"
)
public
boolean
updateByIdTdcDrawing
(
HttpServletRequest
request
,
@RequestBody
TdcDrawing
tdcDrawing
)
{
return
iTdcDrawingService
.
updateById
(
tdcDrawing
);
}
/**
* 根据id查询
*
* @param id
* @return
*/
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"根据id查询"
)
public
TdcDrawing
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
{
return
iTdcDrawingService
.
getById
(
id
);
}
/**
* 列表分页查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表分页查询"
,
notes
=
"列表分页查询"
)
public
IPage
<
TdcDrawing
>
listPage
(
String
pageNum
,
String
pageSize
,
TdcDrawing
tdcDrawing
)
{
Page
<
TdcDrawing
>
pageBean
;
QueryWrapper
<
TdcDrawing
>
tdcDrawingQueryWrapper
=
new
QueryWrapper
<>();
Class
<?
extends
TdcDrawing
>
aClass
=
tdcDrawing
.
getClass
();
Arrays
.
stream
(
aClass
.
getDeclaredFields
()).
forEach
(
field
->
{
try
{
field
.
setAccessible
(
true
);
Object
o
=
field
.
get
(
tdcDrawing
);
if
(
o
!=
null
)
{
Class
<?>
type
=
field
.
getType
();
String
name
=
NameUtils
.
camel2Underline
(
field
.
getName
());
if
(
type
.
equals
(
Integer
.
class
))
{
Integer
fileValue
=
(
Integer
)
field
.
get
(
tdcDrawing
);
tdcDrawingQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
if
(
type
.
equals
(
Long
.
class
))
{
Long
fileValue
=
(
Long
)
field
.
get
(
tdcDrawing
);
tdcDrawingQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
if
(
type
.
equals
(
String
.
class
))
{
String
fileValue
=
(
String
)
field
.
get
(
tdcDrawing
);
tdcDrawingQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
{
String
fileValue
=
(
String
)
field
.
get
(
tdcDrawing
);
tdcDrawingQueryWrapper
.
eq
(
name
,
fileValue
);
}
}
}
catch
(
Exception
e
)
{
}
});
IPage
<
TdcDrawing
>
page
;
if
(
StringUtils
.
isBlank
(
pageNum
)
||
StringUtils
.
isBlank
(
pageSize
))
{
pageBean
=
new
Page
<>(
0
,
Long
.
MAX_VALUE
);
}
else
{
pageBean
=
new
Page
<>(
Integer
.
parseInt
(
pageNum
),
Integer
.
parseInt
(
pageSize
));
}
page
=
iTdcDrawingService
.
page
(
pageBean
,
tdcDrawingQueryWrapper
);
return
page
;
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"saveAttachment"
)
@ApiOperation
(
httpMethod
=
"Post"
,
value
=
"直接查询列表"
,
notes
=
"直接查询列表"
)
public
ResponseModel
<
List
<
TdcDrawing
>>
saveAttachment
(
@RequestBody
JSONObject
attachment
)
{
//当前登录用户信息
AgencyUserModel
userInfo
=
getUserInfo
();
return
ResponseHelper
.
buildResponse
(
iTdcDrawingServiceImpl
.
saveAttachment
(
attachment
,
userInfo
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/listInfo"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询"
)
public
ResponseModel
<
IPage
>
listInfo
(
int
current
,
int
size
)
{
IPage
page
=
new
Page
();
page
.
setSize
(
size
);
page
.
setCurrent
(
current
);
return
ResponseHelper
.
buildResponse
(
iTdcDrawingService
.
page
(
page
));
}
}
amos-boot-system-tdc/amos-boot-module-tdc-biz/src/main/java/com/yeejoin/amos/boot/module/tdc/biz/service/impl/TdcDrawingServiceImpl.java
0 → 100644
View file @
9606e2b4
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tdc
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yeejoin.amos.boot.module.tdc.api.entity.TdcDrawing
;
import
com.yeejoin.amos.boot.module.tdc.api.mapper.TdcDrawingMapper
;
import
com.yeejoin.amos.boot.module.tdc.api.service.ITdcDrawingService
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
* 服务实现类
*
* @author duanwei
* @date 2022-11-22
*/
@Service
public
class
TdcDrawingServiceImpl
extends
ServiceImpl
<
TdcDrawingMapper
,
TdcDrawing
>
implements
ITdcDrawingService
{
public
List
<
TdcDrawing
>
saveAttachment
(
@RequestBody
JSONObject
attachment
,
AgencyUserModel
userInfo
)
{
List
<
TdcDrawing
>
tdcDrawingList
=
new
ArrayList
<>();
if
(!
ValidationUtil
.
isEmpty
(
attachment
))
{
JSONArray
attachment1
=
attachment
.
getJSONArray
(
"attachment"
);
for
(
Object
i
:
attachment1
)
{
TdcDrawing
tdcDrawing
=
new
TdcDrawing
();
List
<
CompanyModel
>
company
=
userInfo
.
getCompanys
();
if
(!
CollectionUtils
.
isEmpty
(
company
))
{
//机构名称
String
companyName
=
company
.
get
(
0
).
getCompanyName
();
tdcDrawing
.
setUploadCompanyName
(
companyName
);
//机构code
String
orgCode
=
company
.
get
(
0
).
getOrgCode
();
tdcDrawing
.
setUploadCompanyCode
(
orgCode
);
//登录人姓名
String
realName
=
userInfo
.
getRealName
();
tdcDrawing
.
setUploadUserName
(
realName
);
}
JSONObject
jsonObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
i
));
tdcDrawing
.
setDrawingName
(
jsonObject
.
getString
(
"name"
));
tdcDrawing
.
setDrawingUrl
(
jsonObject
.
getString
(
"url"
));
tdcDrawing
.
setUploadTime
(
new
Date
());
save
(
tdcDrawing
);
tdcDrawingList
.
add
(
tdcDrawing
);
}
}
return
tdcDrawingList
;
}
}
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