Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
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
fangxinjiang
yifu-mvp
Commits
aa707d9c
Commit
aa707d9c
authored
Jun 17, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增档案服务
parent
2601bd81
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
1000 additions
and
28 deletions
+1000
-28
TAttaInfo.java
...om/yifu/cloud/plus/v1/yifu/archives/entity/TAttaInfo.java
+85
-0
package-info.java
...yifu/cloud/plus/v1/yifu/yifu/base/feign/package-info.java
+0
-1
ArchivesApplication.java
...yifu/cloud/plus/v1/yifu/archives/ArchivesApplication.java
+1
-1
FileUploadController.java
...lus/v1/yifu/archives/controller/FileUploadController.java
+163
-0
TAttaInfoMapper.java
...u/cloud/plus/v1/yifu/archives/mapper/TAttaInfoMapper.java
+40
-0
TAttaInfoService.java
...cloud/plus/v1/yifu/archives/service/TAttaInfoService.java
+52
-0
TAttaInfoServiceImpl.java
...s/v1/yifu/archives/service/impl/TAttaInfoServiceImpl.java
+102
-0
package-info.java
...cloud/plus/v1/yifu/yifu/base/controller/package-info.java
+0
-1
package-info.java
...fu/cloud/plus/v1/yifu/yifu/base/service/package-info.java
+0
-1
application.yml
...ives/yifu-archives-biz/src/main/resources/application.yml
+4
-4
TAttaInfoMapper.xml
...rchives-biz/src/main/resources/mapper/TAttaInfoMapper.xml
+95
-0
pom.xml
yifu-common/yifu-common-core/pom.xml
+6
-1
CommonConstants.java
...ud.plus.v1/yifu/common/core/constant/CommonConstants.java
+24
-0
Common.java
.../com/yifu.cloud.plus.v1/yifu/common/core/util/Common.java
+35
-0
OSSUtil.java
...com/yifu/cloud/plus/v1/yifu/common/core/util/OSSUtil.java
+338
-0
OSSObjectBean.java
...oud/plus/v1/yifu/common/core/util/bean/OSSObjectBean.java
+29
-0
FileVo.java
...va/com/yifu/cloud/plus/v1/yifu/common/core/vo/FileVo.java
+26
-0
YifuAdminApplication.java
...m/yifu.cloud.plus.v1/yifu/admin/YifuAdminApplication.java
+0
-1
pom.xml
yifu-visual/yifu-codegen/pom.xml
+0
-15
YifuCodeGenApplication.java
...fu.cloud.plus.v1/yifu/codegen/YifuCodeGenApplication.java
+0
-3
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/entity/TAttaInfo.java
0 → 100644
View file @
aa707d9c
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.extension.activerecord.Model
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
org.hibernate.validator.constraints.Length
;
import
javax.validation.constraints.NotBlank
;
import
java.time.LocalDateTime
;
/**
* 附件信息表
*
* @author pwang
* @date 2021-02-19 16:16:07
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@TableName
(
"t_atta_info"
)
@Tag
(
name
=
"附件信息表"
)
public
class
TAttaInfo
extends
Model
<
TAttaInfo
>
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键
*/
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@Schema
(
description
=
"主键"
)
private
String
id
;
/**
* 资源名称
*/
@NotBlank
(
message
=
"资源名称不能为空"
)
@Length
(
max
=
50
,
message
=
"资源名称不能超过50个字符"
)
@Schema
(
description
=
"资源名称"
)
private
String
attaName
;
/**
* 资源地址
*/
@NotBlank
(
message
=
"资源地址不能为空"
)
@Length
(
max
=
100
,
message
=
"资源地址不能超过100个字符"
)
@Schema
(
description
=
"资源地址"
)
private
String
attaSrc
;
/**
* 资源大小
*/
@Schema
(
description
=
"资源大小"
)
private
Long
attaSize
;
/**
* 资源类型
*/
@Length
(
max
=
10
,
message
=
"资源类型不能超过10个字符"
)
@Schema
(
description
=
"资源类型"
)
private
String
attaType
;
/**
* 创建人
*/
@Length
(
max
=
32
,
message
=
"创建人不能超过32个字符"
)
@Schema
(
description
=
"创建人"
)
private
String
createUser
;
/**
* 创建时间
*/
@Schema
(
description
=
"创建时间"
)
private
LocalDateTime
createTime
;
/**
* 关系类型(0客户附件1联系人附件2跟进记录附件3合同附件4合同归档附件5报价单)
*/
@NotBlank
(
message
=
"关系类型(0客户附件1联系人附件2跟进记录附件3合同附件4合同归档附件5报价单)不能为空"
)
@Length
(
max
=
2
,
message
=
"关系类型(0客户附件1联系人附件2跟进记录附件3合同附件4合同归档附件5报价单)不能超过2个字符"
)
@Schema
(
description
=
"关系类型(0客户附件1联系人附件2跟进记录附件3合同附件4合同归档附件5报价单)"
)
private
String
relationType
;
/**
* 实体id和关系类型共同确定附件所属
*/
@NotBlank
(
message
=
"实体id和关系类型共同确定附件所属不能为空"
)
@Length
(
max
=
32
,
message
=
"实体id和关系类型共同确定附件所属不能超过32个字符"
)
@Schema
(
description
=
"实体id和关系类型共同确定附件所属"
)
private
String
domainId
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/yifu/base/feign/package-info.java
deleted
100644 → 0
View file @
2601bd81
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
yifu
.
base
.
feign
;
\ No newline at end of file
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/
yifu/base
/ArchivesApplication.java
→
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/
archives
/ArchivesApplication.java
View file @
aa707d9c
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
yifu
.
base
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
;
import
com.yifu.cloud.plus.v1.yifu.common.security.annotation.EnableYifuResourceServer
;
import
org.springframework.boot.SpringApplication
;
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/FileUploadController.java
0 → 100644
View file @
aa707d9c
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
controller
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TAttaInfoService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.FileVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.IOException
;
import
java.net.URL
;
import
java.time.LocalDateTime
;
/**
* @author fang
* 文件上传接口
*/
@RestController
@RequestMapping
(
"/fileUpload"
)
@Tag
(
name
=
"文件上传接口"
)
@Slf4j
public
class
FileUploadController
{
@Autowired
private
OSSUtil
ossUtil
;
@Autowired
private
TAttaInfoService
tAttaInfoService
;
/**
* @Author fxj
* @Description
* @Date 13:49 2022/6/17
* @Param
* @return
**/
@Operation
(
description
=
"OSS文件上传接口"
)
/*@ApiImplicitParams({
@ApiImplicitParam(name = "file", value = "Form文件上传", required = true, dataType = "__file", paramType = "form"),
@ApiImplicitParam(name = "filePath", value = "文件上传路径", required = false, dataType = "String", paramType = "form"),
@ApiImplicitParam(name = "type", value = "关系类型(0客户附件1联系人附件2跟进记录附件3合同附件4合同归档附件5报价单6招标信息7业务评估)", required = true, dataType = "int", paramType = "form"),
@ApiImplicitParam(name = "domain", value = "实体id(传入就插入对应关系,用于编辑)", required = false, paramType = "form")
})*/
@PostMapping
(
value
=
"/ossUploadFile"
)
public
R
<
FileVo
>
uploadImg
(
@RequestBody
MultipartFile
file
,
String
filePath
,
Integer
type
,
String
domain
)
throws
IOException
{
if
(
null
==
file
)
{
return
R
.
failed
(
"文件删除异常,请重新上传!"
);
}
String
fileName
=
file
.
getOriginalFilename
();
if
(
Common
.
isEmpty
(
fileName
))
{
return
R
.
failed
(
"文件名不能为空!"
);
}
if
(
fileName
.
length
()
>
100
)
{
return
R
.
failed
(
"文件名不能超过100个字符!"
);
}
//filePath不传默认存储空间的根目录
//jpg,jpeg,png,bmp
String
key
=
""
;
if
(
Common
.
isNotNull
(
filePath
))
{
key
=
filePath
+
"/"
+
System
.
currentTimeMillis
()
+
fileName
;
}
else
{
key
=
System
.
currentTimeMillis
()
+
fileName
;
}
if
(!
Common
.
checkFile
(
key
))
{
return
R
.
failed
(
"非法上传类型!"
);
}
boolean
flag
=
ossUtil
.
uploadFileByStream
(
file
.
getInputStream
(),
key
,
null
);
FileVo
fileVo
;
TAttaInfo
attaInfo
;
URL
url
;
if
(
flag
)
{
log
.
info
(
"文件:"
+
fileName
+
"上传至存储空间"
+
ossUtil
.
getBucketName
()
+
"成功!"
);
attaInfo
=
initUnitAttaForInsert
(
fileName
,
key
,
file
.
getSize
());
attaInfo
.
setRelationType
(
String
.
valueOf
(
type
));
try
{
attaInfo
=
tAttaInfoService
.
add
(
attaInfo
);
}
catch
(
Exception
e
)
{
log
.
error
(
"OSS文件上传接口异常:"
+
e
.
getMessage
());
ossUtil
.
deleteObject
(
null
,
key
);
return
R
.
failed
(
"fail:"
+
e
.
getMessage
());
}
//有实体id则插入关系,用于编辑
if
(
Common
.
isNotNull
(
domain
))
{
attaInfo
.
setDomainId
(
domain
);
url
=
ossUtil
.
getObjectUrl
(
null
,
attaInfo
.
getAttaSrc
());
fileVo
=
new
FileVo
(
attaInfo
.
getId
(),
attaInfo
.
getAttaName
(),
url
.
toString
());
return
R
.
ok
(
fileVo
,
"success"
);
}
url
=
ossUtil
.
getObjectUrl
(
null
,
attaInfo
.
getAttaSrc
());
fileVo
=
new
FileVo
(
attaInfo
.
getId
(),
attaInfo
.
getAttaName
(),
url
.
toString
());
return
R
.
ok
(
fileVo
,
"success"
);
}
else
{
return
R
.
failed
(
"fail:上传失败"
);
}
}
/**
* @Author fxj
* @Description
* @Date 13:51 2022/6/17
* @Param
* @return
**/
@Operation
(
description
=
"附件删除"
)
@SysLog
(
"附件删除"
)
@DeleteMapping
(
"/ossFileDelete/{id}"
)
public
R
<
Boolean
>
ossFileDelete
(
@PathVariable
String
id
)
{
try
{
TAttaInfo
attaInfo
=
tAttaInfoService
.
getById
(
id
);
if
(
null
==
attaInfo
)
{
return
R
.
failed
(
"无对应附件信息"
);
}
if
(
tAttaInfoService
.
removeById
(
id
))
{
ossUtil
.
deleteObject
(
null
,
attaInfo
.
getAttaSrc
());
return
R
.
ok
(
null
,
"删除成功!"
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"附件删除异常:"
+
e
.
getMessage
());
return
R
.
failed
(
"附件删除异常!"
);
}
return
R
.
ok
(
null
,
"删除失败!"
);
}
/**
* 对象初始化
*
* @param fileName
* @param key
* @param fileSize
* @return
*/
private
TAttaInfo
initUnitAttaForInsert
(
String
fileName
,
String
key
,
long
fileSize
)
{
TAttaInfo
unitAtta
=
new
TAttaInfo
();
char
slash
=
'/'
;
char
point
=
'.'
;
if
(
fileName
.
lastIndexOf
(
slash
)
>=
0
)
{
unitAtta
.
setAttaName
(
fileName
.
substring
(
fileName
.
lastIndexOf
(
slash
)));
}
else
{
unitAtta
.
setAttaName
(
fileName
);
}
unitAtta
.
setAttaSize
(
fileSize
);
unitAtta
.
setAttaSrc
(
key
);
if
(
key
.
lastIndexOf
(
point
)
>=
0
)
{
unitAtta
.
setAttaType
(
key
.
substring
(
key
.
lastIndexOf
(
point
)));
}
unitAtta
.
setCreateTime
(
LocalDateTime
.
now
());
YifuUser
user
=
SecurityUtils
.
getUser
();
unitAtta
.
setCreateUser
(
null
==
user
?
""
:
user
.
getId
().
toString
());
return
unitAtta
;
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/mapper/TAttaInfoMapper.java
0 → 100644
View file @
aa707d9c
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.time.LocalDateTime
;
import
java.util.Collection
;
import
java.util.List
;
/**
* 附件信息表
*
* @author pwang
* @date 2021-02-19 16:16:07
*/
@Mapper
public
interface
TAttaInfoMapper
extends
BaseMapper
<
TAttaInfo
>
{
/**
* 附件信息表简单分页查询
*
* @param tAttaInfo 附件信息表
* @return
*/
IPage
<
TAttaInfo
>
getTAttaInfoPage
(
Page
<
TAttaInfo
>
page
,
@Param
(
"tAttaInfo"
)
TAttaInfo
tAttaInfo
);
/**
* @param tAttaInfo
* @Description: 获取list
* @Author: hgw
* @Date: 2021/5/28 16:02
* @return: java.util.List<com.yifu.cloud.v1.crm.api.entity.TAttaInfo>
**/
List
<
TAttaInfo
>
getTAttaInfoList
(
@Param
(
"tAttaInfo"
)
TAttaInfo
tAttaInfo
);
List
<
TAttaInfo
>
getKeenAtta
(
@Param
(
"dayStart"
)
LocalDateTime
dayStart
,
@Param
(
"values"
)
Collection
<
String
>
values
);
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TAttaInfoService.java
0 → 100644
View file @
aa707d9c
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo
;
import
java.time.LocalDateTime
;
import
java.util.Collection
;
import
java.util.List
;
/**
* 附件信息表
*
* @author pwang
* @date 2021-02-19 16:16:07
*/
public
interface
TAttaInfoService
extends
IService
<
TAttaInfo
>
{
/**
* @Author fxj
* @Description
* @Date 13:48 2022/6/17
* @Param
* @return
**/
IPage
<
TAttaInfo
>
getTAttaInfoPage
(
Page
<
TAttaInfo
>
page
,
TAttaInfo
tAttaInfo
);
/**
* @Author fxj
* @Description
* @Date 13:48 2022/6/17
* @Param
* @return
**/
List
<
TAttaInfo
>
getTAttaInfoList
(
TAttaInfo
tAttaInfo
);
TAttaInfo
add
(
TAttaInfo
attaInfo
);
void
update
(
List
<
TAttaInfo
>
attaList
,
String
domainId
,
String
relationType
);
/**
* @Author fxj
* @Description
* @Date 13:48 2022/6/17
* @Param
* @return
**/
Boolean
batchOssFileDelete
(
List
<
TAttaInfo
>
delAttaList
);
List
<
TAttaInfo
>
getKeenAtta
(
LocalDateTime
dayStart
,
Collection
<
String
>
values
);
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TAttaInfoServiceImpl.java
0 → 100644
View file @
aa707d9c
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TAttaInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TAttaInfoService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
import
java.util.Collection
;
import
java.util.List
;
/**
* 附件信息表
*
* @author pwang
* @date 2021-02-19 16:16:07
*/
@Service
public
class
TAttaInfoServiceImpl
extends
ServiceImpl
<
TAttaInfoMapper
,
TAttaInfo
>
implements
TAttaInfoService
{
@Autowired
private
OSSUtil
ossUtil
;
/**
* 附件信息表简单分页查询
*
* @param tAttaInfo 附件信息表
* @return
*/
@Override
public
IPage
<
TAttaInfo
>
getTAttaInfoPage
(
Page
<
TAttaInfo
>
page
,
TAttaInfo
tAttaInfo
)
{
return
baseMapper
.
getTAttaInfoPage
(
page
,
tAttaInfo
);
}
/**
* @Author fxj
* @Description
* @Date 13:48 2022/6/17
* @Param
* @return
**/
@Override
public
List
<
TAttaInfo
>
getTAttaInfoList
(
TAttaInfo
tAttaInfo
)
{
return
baseMapper
.
getTAttaInfoList
(
tAttaInfo
);
}
@Override
public
TAttaInfo
add
(
TAttaInfo
attaInfo
)
{
this
.
save
(
attaInfo
);
return
attaInfo
;
}
/**
* @Author fxj
* @Description
* @Date 13:48 2022/6/17
* @Param
* @return
**/
@Override
public
void
update
(
List
<
TAttaInfo
>
attaInfoList
,
String
domainId
,
String
relationType
)
{
if
(
attaInfoList
!=
null
)
{
for
(
TAttaInfo
attaInfo
:
attaInfoList
)
{
attaInfo
.
setDomainId
(
domainId
);
attaInfo
.
setRelationType
(
relationType
);
this
.
updateById
(
attaInfo
);
}
}
}
/**
* @Author fxj
* @Description
* @Date 13:48 2022/6/17
* @Param
* @return
**/
@Override
public
Boolean
batchOssFileDelete
(
List
<
TAttaInfo
>
delAttaList
)
{
try
{
for
(
TAttaInfo
delAtta
:
delAttaList
)
{
if
(
this
.
removeById
(
delAtta
.
getId
()))
{
ossUtil
.
deleteObject
(
null
,
delAtta
.
getAttaSrc
());
}
}
return
true
;
}
catch
(
Exception
e
)
{
log
.
error
(
"附件删除异常:"
+
e
.
getMessage
());
return
false
;
}
}
@Override
public
List
<
TAttaInfo
>
getKeenAtta
(
LocalDateTime
dayStart
,
Collection
<
String
>
values
)
{
return
baseMapper
.
getKeenAtta
(
dayStart
,
values
);
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/yifu/base/controller/package-info.java
deleted
100644 → 0
View file @
2601bd81
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
yifu
.
base
.
controller
;
\ No newline at end of file
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/yifu/base/service/package-info.java
deleted
100644 → 0
View file @
2601bd81
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
yifu
.
base
.
service
;
\ No newline at end of file
yifu-archives/yifu-archives-biz/src/main/resources/application.yml
View file @
aa707d9c
...
...
@@ -43,10 +43,10 @@ security:
# 文件上传相关 支持阿里云、华为云、腾讯、minio
oss
:
endpoint
:
http://
minio.yifu4cloud
.com
accessKey
:
lengleng
secretKey
:
lengleng
bucket-name
:
tmp
endpoint
:
http://
oss-cn-beijing.aliyuncs
.com
accessKey
:
LTAIDh9goA3jgpun
secretKey
:
eN8EHPAZxglNfcUCMhAT02cy93omLa
bucket-name
:
yf-hr-static-source
# swagger 配置
#swagger:
# enabled: true
...
...
yifu-archives/yifu-archives-biz/src/main/resources/mapper/TAttaInfoMapper.xml
0 → 100644
View file @
aa707d9c
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yifu.cloud.plus.v1.yifu.archives.mapper.TAttaInfoMapper"
>
<resultMap
id=
"tAttaInfoMap"
type=
"com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo"
>
<id
property=
"id"
column=
"id"
/>
<result
property=
"attaName"
column=
"atta_name"
/>
<result
property=
"attaSrc"
column=
"atta_src"
/>
<result
property=
"attaSize"
column=
"atta_size"
/>
<result
property=
"attaType"
column=
"atta_type"
/>
<result
property=
"createUser"
column=
"create_user"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"relationType"
column=
"relation_type"
/>
<result
property=
"domainId"
column=
"domain_id"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
a.id,
a.atta_name,
a.atta_src,
a.atta_size,
a.atta_type,
a.create_user,
a.create_time,
a.relation_type,
a.domain_id
</sql>
<sql
id=
"tAttaInfo_where"
>
<if
test=
"tAttaInfo != null"
>
<if
test=
"tAttaInfo.id != null and tAttaInfo.id.trim() != ''"
>
AND a.id = #{tAttaInfo.id}
</if>
<if
test=
"tAttaInfo.attaName != null and tAttaInfo.attaName.trim() != ''"
>
AND a.atta_name = #{tAttaInfo.attaName}
</if>
<if
test=
"tAttaInfo.attaSrc != null and tAttaInfo.attaSrc.trim() != ''"
>
AND a.atta_src = #{tAttaInfo.attaSrc}
</if>
<if
test=
"tAttaInfo.attaSize != null"
>
AND a.atta_size = #{tAttaInfo.attaSize}
</if>
<if
test=
"tAttaInfo.attaType != null and tAttaInfo.attaType.trim() != ''"
>
AND a.atta_type = #{tAttaInfo.attaType}
</if>
<if
test=
"tAttaInfo.createUser != null and tAttaInfo.createUser.trim() != ''"
>
AND a.create_user = #{tAttaInfo.createUser}
</if>
<if
test=
"tAttaInfo.createTime != null"
>
AND a.create_time = #{tAttaInfo.createTime}
</if>
<if
test=
"tAttaInfo.relationType != null and tAttaInfo.relationType.trim() != ''"
>
AND a.relation_type = #{tAttaInfo.relationType}
</if>
<if
test=
"tAttaInfo.domainId != null and tAttaInfo.domainId.trim() != ''"
>
AND a.domain_id = #{tAttaInfo.domainId}
</if>
</if>
</sql>
<!--tAttaInfo简单分页查询-->
<select
id=
"getTAttaInfoPage"
resultMap=
"tAttaInfoMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM t_atta_info a
<where>
1=1
<include
refid=
"tAttaInfo_where"
/>
</where>
</select>
<!--tAttaInfo 获取list-->
<select
id=
"getTAttaInfoList"
resultMap=
"tAttaInfoMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM t_atta_info a
<where>
1=1
<include
refid=
"tAttaInfo_where"
/>
</where>
</select>
<select
id=
"getKeenAtta"
resultMap=
"tAttaInfoMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM t_atta_info a
<where>
1=1
<if
test=
"values != null and values.size() > 0"
>
and a.domain_id in
<foreach
collection=
"values"
item=
"param"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{param}
</foreach>
</if>
and a.create_time >= #{dayStart}
and a.relation_type in ("3","4")
</where>
</select>
</mapper>
yifu-common/yifu-common-core/pom.xml
View file @
aa707d9c
...
...
@@ -72,6 +72,11 @@
<version>
2.6
</version>
<scope>
compile
</scope>
</dependency>
<!-- aliyun-sdk-oss -->
<dependency>
<groupId>
com.aliyun.oss
</groupId>
<artifactId>
aliyun-sdk-oss
</artifactId>
<version>
3.5.0
</version>
</dependency>
</dependencies>
</project>
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/constant/CommonConstants.java
View file @
aa707d9c
...
...
@@ -139,4 +139,28 @@ public interface CommonConstants {
* @author fxj
*/
int
ONE_INT
=
1
;
/**
* 个位数字(阿里编码规约不允许直接使用‘魔法值’)
* @Author pwang
* @Date 2019-08-02 16:39
**/
public
static
int
[]
dingleDigitIntArray
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
};
/**
* 个位数字串(阿里编码规约不允许直接使用‘魔法值’)
* @Author pwang
* @Date 2019-08-02 16:39
**/
public
static
String
[]
dingleDigitStrArray
=
{
"0"
,
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
,
"7"
,
"8"
,
"9"
,
"10"
,
"11"
,
"12"
,
"13"
,
"14"
,
"15"
,
"16"
,
"17"
};
/**
* 逗号
* @Author fxj
* @Date
* @param null
* @return
**/
public
static
final
char
COMMA_CHAR
=
','
;
public
static
final
char
SPOT_CHAR
=
'.'
;
}
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/util/Common.java
View file @
aa707d9c
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
core
.
util
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
lombok.extern.slf4j.Slf4j
;
import
java.util.regex.Matcher
;
...
...
@@ -54,4 +55,38 @@ public class Common {
Matcher
match
=
pattern
.
matcher
(
str
);
return
match
.
matches
()
!=
false
;
}
/**
* 允许上传的文件类型
* @Author pwang
* @Date 2020-01-07 15:52
* @param null
* @return
**/
private
static
final
String
suffixList
=
"gif|jpg|jpeg|png|bmp|xls|xlsx|csv|pdf|docx|doc|m4a|mp3|zip|rar|txt"
;
/**
* 判断是否为允许的上传文件类型,true表示允许
*/
public
static
boolean
checkFile
(
String
fileName
)
{
// 获取文件后缀
String
suffix
=
getSuffix
(
fileName
);
if
(
null
!=
suffix
){
if
(
suffixList
.
contains
(
suffix
.
trim
().
toLowerCase
()))
{
return
true
;
}
}
return
false
;
}
/**
* 判断是否为允许的上传文件类型,true表示允许
*/
public
static
String
getSuffix
(
String
fileName
)
{
if
(
isEmpty
(
fileName
)
||
fileName
.
lastIndexOf
(
CommonConstants
.
SPOT_CHAR
)
<
0
){
return
null
;
}
// 获取文件后缀
return
fileName
.
substring
(
fileName
.
lastIndexOf
(
CommonConstants
.
SPOT_CHAR
)
+
1
,
fileName
.
length
());
}
}
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/util/OSSUtil.java
0 → 100644
View file @
aa707d9c
This diff is collapsed.
Click to expand it.
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/util/bean/OSSObjectBean.java
0 → 100644
View file @
aa707d9c
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
core
.
util
.
bean
;
import
lombok.Data
;
/**
* @program: master
* @description: 文件打包工具类
* @author: pwang
* @create: 2019-10-30 15:48
**/
@Data
public
class
OSSObjectBean
{
/**
* 生成文件的名称(要带后缀)
* @Author pwang
* @Date 2019-10-30 19:03
* @param null
* @return
**/
String
name
;
/**
* oss获取文件的key
* @Author pwang
* @Date 2019-10-30 19:05
* @param null
* @return
**/
String
key
;
}
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/vo/FileVo.java
0 → 100644
View file @
aa707d9c
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
core
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @program: master
* @description: 前端要求返回结构
* @author: wangan
**/
@Data
public
class
FileVo
implements
Serializable
{
protected
String
uid
;
protected
String
name
;
protected
String
status
;
protected
String
url
;
protected
String
type
;
public
FileVo
(
String
uid
,
String
name
,
String
url
)
{
this
.
uid
=
uid
;
this
.
name
=
name
;
this
.
status
=
"done"
;
this
.
url
=
url
;
}
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/YifuAdminApplication.java
View file @
aa707d9c
...
...
@@ -25,7 +25,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
* @date 2018年06月21日 用户统一管理系统
*/
@EnableYifuResourceServer
//@EnableYifuFeignClients
@SpringBootApplication
public
class
YifuAdminApplication
{
...
...
yifu-visual/yifu-codegen/pom.xml
View file @
aa707d9c
...
...
@@ -36,21 +36,6 @@
<groupId>
com.yifu.cloud.plus.v1
</groupId>
<artifactId>
yifu-common-swagger
</artifactId>
</dependency>
<!--注册中心客户端-->
<!--<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>-->
<!--配置中心客户端-->
<!--<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>-->
<!--断路器依赖-->
<!--<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-feign</artifactId>
</dependency>-->
<!--数据源-->
<dependency>
<groupId>
com.yifu.cloud.plus.v1
</groupId>
...
...
yifu-visual/yifu-codegen/src/main/java/com/yifu.cloud.plus.v1/yifu/codegen/YifuCodeGenApplication.java
View file @
aa707d9c
...
...
@@ -25,10 +25,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
* @author lengleng
* @date 2020/03/11 代码生成模块
*/
//@EnableYifuDoc
@EnableDynamicDataSource
//@EnableYifuFeignClients
//@EnableDiscoveryClient
@SpringBootApplication
@EnableYifuResourceServer
public
class
YifuCodeGenApplication
{
...
...
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