Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pms
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
pms
Commits
a3df433c
提交
a3df433c
authored
6月 09, 2023
作者:
zhenjie
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' of
ssh://git.mmcuav.cn:8222/iuav/pms
into develop
上级
ea4eb88b
6569e54f
隐藏空白字符变更
内嵌
并排
正在显示
72 个修改的文件
包含
2331 行增加
和
1490 行删除
+2331
-1490
develop.yml
.github/workflows/develop.yml
+1
-1
master.yml
.github/workflows/master.yml
+1
-1
kustomization.yaml
kustomization/overlays/dev/kustomization.yaml
+1
-1
PmsApplication.java
src/main/java/com/mmc/pms/PmsApplication.java
+1
-1
MvcConfiguration.java
src/main/java/com/mmc/pms/auth/MvcConfiguration.java
+7
-9
NotCheckUriConfig.java
src/main/java/com/mmc/pms/auth/NotCheckUriConfig.java
+5
-6
TokenCheckHandleInterceptor.java
...in/java/com/mmc/pms/auth/TokenCheckHandleInterceptor.java
+71
-67
BUserAccountQO.java
src/main/java/com/mmc/pms/auth/dto/BUserAccountQO.java
+69
-0
LoginSuccessDTO.java
src/main/java/com/mmc/pms/auth/dto/LoginSuccessDTO.java
+15
-15
UserAccountSimpleDTO.java
src/main/java/com/mmc/pms/auth/dto/UserAccountSimpleDTO.java
+52
-0
TokenConstant.java
src/main/java/com/mmc/pms/constant/TokenConstant.java
+9
-0
BackstageCategoriesController.java
...com/mmc/pms/controller/BackstageCategoriesController.java
+12
-0
BackstageProductSpecController.java
...om/mmc/pms/controller/BackstageProductSpecController.java
+1
-3
BackstageTaskServiceController.java
...om/mmc/pms/controller/BackstageTaskServiceController.java
+44
-40
BaseController.java
src/main/java/com/mmc/pms/controller/BaseController.java
+38
-38
DirectoryController.java
...main/java/com/mmc/pms/controller/DirectoryController.java
+61
-0
MiniProgramDeviceController.java
...a/com/mmc/pms/controller/MiniProgramDeviceController.java
+7
-11
PartUploadController.java
...ain/java/com/mmc/pms/controller/PartUploadController.java
+188
-189
UploadController.java
src/main/java/com/mmc/pms/controller/UploadController.java
+482
-482
WebAndMiniProgramCategoryController.java
...c/pms/controller/WebAndMiniProgramCategoryController.java
+0
-26
WebDeviceController.java
...main/java/com/mmc/pms/controller/WebDeviceController.java
+8
-12
MiniLeaseGoodsController.java
...com/mmc/pms/controller/mini/MiniLeaseGoodsController.java
+40
-0
WebLeaseGoodsController.java
...a/com/mmc/pms/controller/web/WebLeaseGoodsController.java
+23
-0
BackstageTaskServiceDao.java
src/main/java/com/mmc/pms/dao/BackstageTaskServiceDao.java
+9
-7
CategoriesDao.java
src/main/java/com/mmc/pms/dao/CategoriesDao.java
+14
-5
DirectoryDao.java
src/main/java/com/mmc/pms/dao/DirectoryDao.java
+18
-0
GoodsInfoDao.java
src/main/java/com/mmc/pms/dao/GoodsInfoDao.java
+4
-0
ProductDao.java
src/main/java/com/mmc/pms/dao/ProductDao.java
+1
-0
WebDeviceDao.java
src/main/java/com/mmc/pms/dao/WebDeviceDao.java
+4
-3
Categories.java
src/main/java/com/mmc/pms/entity/Categories.java
+6
-0
DirectoryDO.java
src/main/java/com/mmc/pms/entity/DirectoryDO.java
+8
-2
GoodsInfo.java
src/main/java/com/mmc/pms/entity/GoodsInfo.java
+6
-0
MallProdSkuInfoSpecDO.java
src/main/java/com/mmc/pms/entity/MallProdSkuInfoSpecDO.java
+12
-10
RepoCashDO.java
src/main/java/com/mmc/pms/entity/RepoCashDO.java
+48
-48
ServiceDO.java
src/main/java/com/mmc/pms/entity/ServiceDO.java
+47
-55
UserAppApi.java
src/main/java/com/mmc/pms/feign/UserAppApi.java
+49
-0
FeignConfiguration.java
...ain/java/com/mmc/pms/feign/config/FeignConfiguration.java
+20
-0
UserAppApiHystrix.java
...ain/java/com/mmc/pms/feign/hystrix/UserAppApiHystrix.java
+33
-0
JsonUtil.java
src/main/java/com/mmc/pms/json/JsonUtil.java
+95
-95
AllCategoryDTO.java
...java/com/mmc/pms/model/categories/dto/AllCategoryDTO.java
+28
-0
CategoriesDTO.java
.../java/com/mmc/pms/model/categories/dto/CategoriesDTO.java
+34
-0
CategoriesInfoListDTO.java
...m/mmc/pms/model/categories/dto/CategoriesInfoListDTO.java
+27
-0
LeaseGoodsInfoDTO.java
...n/java/com/mmc/pms/model/lease/dto/LeaseGoodsInfoDTO.java
+29
-0
GoodsInfoQO.java
src/main/java/com/mmc/pms/model/qo/GoodsInfoQO.java
+1
-1
IndustrySkuQO.java
src/main/java/com/mmc/pms/model/qo/IndustrySkuQO.java
+1
-1
ProductSkuQO.java
src/main/java/com/mmc/pms/model/qo/ProductSkuQO.java
+1
-1
ServiceQO.java
src/main/java/com/mmc/pms/model/qo/ServiceQO.java
+30
-21
WareInfoQO.java
src/main/java/com/mmc/pms/model/qo/WareInfoQO.java
+18
-37
QueryClassifyVO.java
src/main/java/com/mmc/pms/model/sale/vo/QueryClassifyVO.java
+1
-1
ServiceDTO.java
src/main/java/com/mmc/pms/model/work/dto/ServiceDTO.java
+113
-0
ServiceVO.java
src/main/java/com/mmc/pms/model/work/vo/ServiceVO.java
+36
-26
Page.java
src/main/java/com/mmc/pms/page/Page.java
+0
-6
BackstageTaskService.java
src/main/java/com/mmc/pms/service/BackstageTaskService.java
+8
-8
CategoriesService.java
src/main/java/com/mmc/pms/service/CategoriesService.java
+16
-0
BackstageTaskServiceImpl.java
...va/com/mmc/pms/service/Impl/BackstageTaskServiceImpl.java
+82
-29
CategoriesServiceImpl.java
.../java/com/mmc/pms/service/Impl/CategoriesServiceImpl.java
+72
-10
GoodsInfoServiceImpl.java
...n/java/com/mmc/pms/service/Impl/GoodsInfoServiceImpl.java
+35
-15
ProductServiceImpl.java
...ain/java/com/mmc/pms/service/Impl/ProductServiceImpl.java
+4
-4
WebDeviceServiceImpl.java
...n/java/com/mmc/pms/service/Impl/WebDeviceServiceImpl.java
+33
-16
WebDeviceService.java
src/main/java/com/mmc/pms/service/WebDeviceService.java
+2
-1
BizException.java
src/main/java/com/mmc/pms/util/BizException.java
+72
-77
PathUtil.java
src/main/java/com/mmc/pms/util/PathUtil.java
+4
-4
application-dev.yml
src/main/resources/application-dev.yml
+5
-1
application-local.yml
src/main/resources/application-local.yml
+4
-0
application-prod.yml
src/main/resources/application-prod.yml
+5
-1
CategoriesDao.xml
src/main/resources/mapper/CategoriesDao.xml
+26
-2
DirectoryDao.xml
src/main/resources/mapper/DirectoryDao.xml
+15
-0
GoodsInfoDao.xml
src/main/resources/mapper/GoodsInfoDao.xml
+31
-0
ProductDao.xml
src/main/resources/mapper/ProductDao.xml
+1
-1
WebDeviceDao.xml
src/main/resources/mapper/WebDeviceDao.xml
+77
-66
BackstageTaskServiceDao.xml
src/main/resources/mapper/work/BackstageTaskServiceDao.xml
+9
-33
not-check.yml
src/main/resources/not-check.yml
+1
-1
没有找到文件。
.github/workflows/develop.yml
浏览文件 @
a3df433c
...
@@ -73,7 +73,7 @@ jobs:
...
@@ -73,7 +73,7 @@ jobs:
# 2.2 (Optional) Build and push image ACR EE
# 2.2 (Optional) Build and push image ACR EE
-
name
:
Build and push image to ACR EE
-
name
:
Build and push image to ACR EE
run
:
|
run
:
|
mvn clean package
mvn clean package
-DskipTests
docker build -t "$ACR_EE_REGISTRY/$ACR_EE_NAMESPACE/$ACR_EE_IMAGE:$TAG" .
docker build -t "$ACR_EE_REGISTRY/$ACR_EE_NAMESPACE/$ACR_EE_IMAGE:$TAG" .
docker push "$ACR_EE_REGISTRY/$ACR_EE_NAMESPACE/$ACR_EE_IMAGE:$TAG"
docker push "$ACR_EE_REGISTRY/$ACR_EE_NAMESPACE/$ACR_EE_IMAGE:$TAG"
...
...
.github/workflows/master.yml
浏览文件 @
a3df433c
...
@@ -75,7 +75,7 @@ jobs:
...
@@ -75,7 +75,7 @@ jobs:
# 2.2 (Optional) Build and push image ACR EE
# 2.2 (Optional) Build and push image ACR EE
-
name
:
Build and push image to ACR EE
-
name
:
Build and push image to ACR EE
run
:
|
run
:
|
mvn clean package
mvn clean package
-DskipTests
docker build -t "$ACR_EE_REGISTRY/$ACR_EE_NAMESPACE/$ACR_EE_IMAGE:$TAG" .
docker build -t "$ACR_EE_REGISTRY/$ACR_EE_NAMESPACE/$ACR_EE_IMAGE:$TAG" .
docker push "$ACR_EE_REGISTRY/$ACR_EE_NAMESPACE/$ACR_EE_IMAGE:$TAG"
docker push "$ACR_EE_REGISTRY/$ACR_EE_NAMESPACE/$ACR_EE_IMAGE:$TAG"
...
...
kustomization/overlays/dev/kustomization.yaml
浏览文件 @
a3df433c
...
@@ -18,4 +18,4 @@ patches:
...
@@ -18,4 +18,4 @@ patches:
images
:
images
:
-
name
:
REGISTRY/NAMESPACE/IMAGE:TAG
-
name
:
REGISTRY/NAMESPACE/IMAGE:TAG
newName
:
mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/pms
newName
:
mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/pms
newTag
:
13789340e2fa8004147607d0f189f4e7668bfe91
newTag
:
3885e9f9d2c3bd00e73625bb6a9e0e56aa42e98c
src/main/java/com/mmc/pms/PmsApplication.java
浏览文件 @
a3df433c
...
@@ -5,7 +5,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
...
@@ -5,7 +5,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
@SpringBootApplication
@SpringBootApplication
@EnableFeignClients
@EnableFeignClients
(
basePackages
=
"com.mmc.pms.feign"
)
public
class
PmsApplication
{
public
class
PmsApplication
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
...
...
src/main/java/com/mmc/pms/auth/MvcConfiguration.java
浏览文件 @
a3df433c
...
@@ -6,18 +6,16 @@ import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
...
@@ -6,18 +6,16 @@ import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
/**
/**
* @author: zj
* @author: zj @Date: 2023/5/28 10:52
* @Date: 2023/5/28 10:52
*/
*/
@Configuration
@Configuration
public
class
MvcConfiguration
implements
WebMvcConfigurer
{
public
class
MvcConfiguration
implements
WebMvcConfigurer
{
@Autowired
@Autowired
private
TokenCheckHandleInterceptor
tokenCheckHandleInterceptor
;
private
TokenCheckHandleInterceptor
tokenCheckHandleInterceptor
;
@Override
@Override
public
void
addInterceptors
(
InterceptorRegistry
registry
)
{
public
void
addInterceptors
(
InterceptorRegistry
registry
)
{
registry
.
addInterceptor
(
tokenCheckHandleInterceptor
);
registry
.
addInterceptor
(
tokenCheckHandleInterceptor
);
WebMvcConfigurer
.
super
.
addInterceptors
(
registry
);
WebMvcConfigurer
.
super
.
addInterceptors
(
registry
);
}
}
}
}
src/main/java/com/mmc/pms/auth/NotCheckUriConfig.java
浏览文件 @
a3df433c
...
@@ -8,16 +8,15 @@ import org.springframework.context.annotation.PropertySource;
...
@@ -8,16 +8,15 @@ import org.springframework.context.annotation.PropertySource;
import
java.util.List
;
import
java.util.List
;
/**
/**
* @author: zj
* @author: zj @Date: 2023/5/28 13:54
* @Date: 2023/5/28 13:54
*/
*/
@Data
@Data
@Configuration
@Configuration
@ConfigurationProperties
(
prefix
=
"data-filter"
,
ignoreUnknownFields
=
false
)
@ConfigurationProperties
(
prefix
=
"data-filter"
,
ignoreUnknownFields
=
false
)
@PropertySource
(
"classpath:not-check.yml"
)
@PropertySource
(
"classpath:not-check.yml"
)
public
class
NotCheckUriConfig
{
public
class
NotCheckUriConfig
{
// 不需要验证token的请求地址
// 不需要验证token的请求地址
private
List
<
String
>
notAuthPath
;
private
List
<
String
>
notAuthPath
;
// 不需要验证token的请求地址;// 不需要验证token的请求地址
// 不需要验证token的请求地址;// 不需要验证token的请求地址
private
List
<
String
>
uploadPath
;
private
List
<
String
>
uploadPath
;
}
}
src/main/java/com/mmc/pms/auth/TokenCheckHandleInterceptor.java
浏览文件 @
a3df433c
...
@@ -16,84 +16,88 @@ import javax.servlet.http.HttpServletResponse;
...
@@ -16,84 +16,88 @@ import javax.servlet.http.HttpServletResponse;
import
java.io.PrintWriter
;
import
java.io.PrintWriter
;
/**
/**
* @author: zj
* @author: zj @Date: 2023/5/28 10:46
* @Date: 2023/5/28 10:46
*/
*/
@Slf4j
@Slf4j
@Component
@Component
public
class
TokenCheckHandleInterceptor
implements
HandlerInterceptor
{
public
class
TokenCheckHandleInterceptor
implements
HandlerInterceptor
{
@Autowired
@Autowired
private
StringRedisTemplate
stringRedisTemplate
;
private
StringRedisTemplate
stringRedisTemplate
;
@Autowired
@Autowired
private
NotCheckUriConfig
notCheckUriConfig
;
private
NotCheckUriConfig
notCheckUriConfig
;
@Override
@Override
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
String
requestURI
=
request
.
getRequestURI
();
throws
Exception
{
// //根据uri确认是否要拦截
String
requestURI
=
request
.
getRequestURI
();
if
(!
shouldFilter
(
requestURI
))
{
// //根据uri确认是否要拦截
return
true
;
if
(!
shouldFilter
(
requestURI
))
{
}
return
true
;
String
token
=
request
.
getHeader
(
"token"
);
if
(
StringUtils
.
isBlank
(
token
))
{
exceptionProcess
(
response
);
return
false
;
}
String
tokenJson
=
stringRedisTemplate
.
opsForValue
().
get
(
token
);
if
(
StringUtils
.
isBlank
(
tokenJson
))
{
exceptionProcess
(
response
);
return
false
;
}
//
// String serverName = request.getServerName();
// String remoteHost = request.getRemoteHost();
// log.info("hostName: {}", hostName);
// log.info("serverName: {}", serverName);
// log.info("remoteHost: {}", remoteHost);
// log.info("forwardedFor: {}", forwardedFor);
// log.info("forwardedHost: {}", forwardedHost);
// if (hostName.equals("iuav.mmcuav.cn") || hostName.equals("test.iuav.mmcuav.cn") || hostName.equals("www.iuav.shop") || hostName.equals("test.iuav.shop")){
// String token = request.getHeader("token");
// if (StringUtils.isBlank(token)){
// exceptionProcess(response);
// return false;
// }
// String tokenJson = stringRedisTemplate.opsForValue().get(token);
// if (StringUtils.isBlank(tokenJson)){
// exceptionProcess(response);
// return false;
// }
// return true;
// }
//测试-打印请求信息
return
true
;
}
}
String
token
=
request
.
getHeader
(
"token"
);
@Override
if
(
StringUtils
.
isBlank
(
token
))
{
public
void
postHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
ModelAndView
modelAndView
)
throws
Exception
{
exceptionProcess
(
response
);
return
false
;
}
}
String
tokenJson
=
stringRedisTemplate
.
opsForValue
().
get
(
token
);
@Override
if
(
StringUtils
.
isBlank
(
tokenJson
))
{
public
void
afterCompletion
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
Exception
ex
)
throws
Exception
{
exceptionProcess
(
response
);
return
false
;
}
}
//
// String serverName = request.getServerName();
// String remoteHost = request.getRemoteHost();
// log.info("hostName: {}", hostName);
// log.info("serverName: {}", serverName);
// log.info("remoteHost: {}", remoteHost);
// log.info("forwardedFor: {}", forwardedFor);
// log.info("forwardedHost: {}", forwardedHost);
// if (hostName.equals("iuav.mmcuav.cn") || hostName.equals("test.iuav.mmcuav.cn") ||
// hostName.equals("www.iuav.shop") || hostName.equals("test.iuav.shop")){
// String token = request.getHeader("token");
// if (StringUtils.isBlank(token)){
// exceptionProcess(response);
// return false;
// }
// String tokenJson = stringRedisTemplate.opsForValue().get(token);
// if (StringUtils.isBlank(tokenJson)){
// exceptionProcess(response);
// return false;
// }
// return true;
// }
// 测试-打印请求信息
return
true
;
}
public
void
exceptionProcess
(
HttpServletResponse
response
)
throws
Exception
{
@Override
response
.
setContentType
(
"application/json;charset=utf-8"
);
public
void
postHandle
(
PrintWriter
writer
=
response
.
getWriter
();
HttpServletRequest
request
,
writer
.
write
(
ResultBody
.
error
(
ResultEnum
.
LOGIN_ACCOUNT_STATUS_ERROR
).
toString
());
HttpServletResponse
response
,
writer
.
close
();
Object
handler
,
}
ModelAndView
modelAndView
)
throws
Exception
{}
@Override
public
void
afterCompletion
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
Exception
ex
)
throws
Exception
{}
public
void
exceptionProcess
(
HttpServletResponse
response
)
throws
Exception
{
response
.
setContentType
(
"application/json;charset=utf-8"
);
PrintWriter
writer
=
response
.
getWriter
();
writer
.
write
(
ResultBody
.
error
(
ResultEnum
.
LOGIN_ACCOUNT_STATUS_ERROR
).
toString
());
writer
.
close
();
}
private
boolean
shouldFilter
(
String
path
)
{
private
boolean
shouldFilter
(
String
path
)
{
// 路径与配置的相匹配,则执行过滤
// 路径与配置的相匹配,则执行过滤
for
(
String
pathPattern
:
notCheckUriConfig
.
getNotAuthPath
())
{
for
(
String
pathPattern
:
notCheckUriConfig
.
getNotAuthPath
())
{
if
(
PathUtil
.
isPathMatch
(
pathPattern
,
path
))
{
if
(
PathUtil
.
isPathMatch
(
pathPattern
,
path
))
{
// 如果匹配
// 如果匹配
return
false
;
return
false
;
}
}
}
return
true
;
}
}
return
true
;
}
}
}
src/main/java/com/mmc/pms/auth/dto/BUserAccountQO.java
0 → 100644
浏览文件 @
a3df433c
package
com
.
mmc
.
pms
.
auth
.
dto
;
import
com.mmc.pms.common.Page
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* @author: zj
* @Date: 2023/5/25 13:32
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
BUserAccountQO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"关键字"
,
required
=
false
)
private
String
keyword
;
@ApiModelProperty
(
value
=
"地区"
,
required
=
false
)
private
String
area
;
@ApiModelProperty
(
value
=
"省份编码"
,
required
=
false
)
private
Integer
provinceCode
;
@ApiModelProperty
(
value
=
"城市编码"
,
required
=
false
)
private
Integer
cityCode
;
@ApiModelProperty
(
value
=
"县区编码"
,
required
=
false
)
private
Integer
districtCode
;
@ApiModelProperty
(
value
=
"角色id"
,
required
=
false
)
private
Integer
roleId
;
@ApiModelProperty
(
value
=
"账号状态:0禁用 1可用"
)
private
Integer
accountStatus
;
@ApiModelProperty
(
value
=
"账号状态:0合伙人 1员工"
)
private
Integer
userType
;
@ApiModelProperty
(
value
=
"用户id集合"
)
private
List
<
Integer
>
userIds
;
@ApiModelProperty
(
value
=
"推荐单位id"
)
private
Integer
rcdCompanyId
;
@ApiModelProperty
(
value
=
"单位集合"
,
hidden
=
true
)
private
List
<
Integer
>
companys
;
@ApiModelProperty
(
value
=
"页码"
,
required
=
true
)
@NotNull
(
message
=
"页码不能为空"
,
groups
=
Page
.
class
)
@Min
(
value
=
1
,
groups
=
Page
.
class
)
private
Integer
pageNo
;
@ApiModelProperty
(
value
=
"每页显示数"
,
required
=
true
)
@NotNull
(
message
=
"每页显示数不能为空"
,
groups
=
Page
.
class
)
@Min
(
value
=
1
,
groups
=
Page
.
class
)
private
Integer
pageSize
;
public
void
buildCurrentPage
()
{
this
.
pageNo
=
(
pageNo
-
1
)
*
pageSize
;
}
}
src/main/java/com/mmc/pms/auth/dto/LoginSuccessDTO.java
浏览文件 @
a3df433c
...
@@ -7,24 +7,24 @@ import lombok.NoArgsConstructor;
...
@@ -7,24 +7,24 @@ import lombok.NoArgsConstructor;
import
java.io.Serializable
;
import
java.io.Serializable
;
/**
/**
* @author 作者 geDuo
* @author 作者 geDuo
* @version 创建时间:2021年8月31日 下午8:06:14
* @version 创建时间:2021年8月31日 下午8:06:14
* @explain 类说明
* @explain 类说明
*/
*/
@Builder
@Builder
@Data
@Data
@AllArgsConstructor
@AllArgsConstructor
@NoArgsConstructor
@NoArgsConstructor
public
class
LoginSuccessDTO
implements
Serializable
{
public
class
LoginSuccessDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
1200834589953161925L
;
private
static
final
long
serialVersionUID
=
-
1200834589953161925L
;
private
String
token
;
private
String
token
;
private
Integer
userAccountId
;
private
Integer
userAccountId
;
private
String
accountNo
;
private
String
accountNo
;
private
Integer
portType
;
private
Integer
portType
;
private
String
uid
;
private
String
uid
;
private
String
phoneNum
;
private
String
phoneNum
;
private
String
userName
;
private
String
userName
;
private
String
nickName
;
private
String
nickName
;
// private RoleInfoDTO roleInfo;
// private RoleInfoDTO roleInfo;
}
}
src/main/java/com/mmc/pms/auth/dto/UserAccountSimpleDTO.java
0 → 100644
浏览文件 @
a3df433c
package
com
.
mmc
.
pms
.
auth
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
/**
* @author: zj
* @Date: 2023/5/18 17:28
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public
class
UserAccountSimpleDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
3451336520607073343L
;
@ApiModelProperty
(
value
=
"用户id"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"用户类型"
)
private
Integer
accountType
;
@ApiModelProperty
(
value
=
"用户账号"
)
private
String
accountNo
;
@ApiModelProperty
(
value
=
"用户uid"
)
private
String
uid
;
@ApiModelProperty
(
value
=
"手机号"
)
private
String
phoneNum
;
@ApiModelProperty
(
value
=
"用户名称"
)
private
String
userName
;
@ApiModelProperty
(
value
=
"用户昵称"
)
private
String
nickName
;
@ApiModelProperty
(
value
=
"用户头像"
)
private
String
userImg
;
@ApiModelProperty
(
value
=
"用户性别:0未知、1男、2女"
)
private
Integer
userSex
;
@ApiModelProperty
(
value
=
"用户邮箱"
)
private
String
email
;
@ApiModelProperty
(
value
=
"用户来源,0自然流、1海报、2抖音、3公众号、4社群、5招投标、6官网"
)
private
Integer
source
;
@ApiModelProperty
(
value
=
"用户可用状态:0禁用、1可用"
)
private
Integer
accountStatus
;
@ApiModelProperty
(
value
=
"账号类型:0后台管理账号 ; 100云享飞-客户端;"
)
private
Integer
portType
;
@ApiModelProperty
(
value
=
"企业认证状态, 0未通过,1通过"
)
private
Integer
companyAuthStatus
;
@ApiModelProperty
(
value
=
"合作标签id"
)
private
Integer
cooperationTagId
;
}
\ No newline at end of file
src/main/java/com/mmc/pms/constant/TokenConstant.java
0 → 100644
浏览文件 @
a3df433c
package
com
.
mmc
.
pms
.
constant
;
/**
* @author: zj
* @Date: 2023/5/31 20:07
*/
public
class
TokenConstant
{
public
static
final
String
TOKEN
=
"token"
;
}
src/main/java/com/mmc/pms/controller/BackstageCategoriesController.java
浏览文件 @
a3df433c
package
com
.
mmc
.
pms
.
controller
;
package
com
.
mmc
.
pms
.
controller
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.entity.Categories
;
import
com.mmc.pms.model.categories.dto.AllCategoryDTO
;
import
com.mmc.pms.model.categories.dto.ClassifyDetailsDTO
;
import
com.mmc.pms.model.categories.dto.ClassifyDetailsDTO
;
import
com.mmc.pms.model.categories.dto.ClassifyInfoDTO
;
import
com.mmc.pms.model.categories.dto.ClassifyInfoDTO
;
import
com.mmc.pms.model.categories.vo.CategoriesInfoVO
;
import
com.mmc.pms.model.categories.vo.ClassifyInfoVO
;
import
com.mmc.pms.model.categories.vo.ClassifyInfoVO
;
import
com.mmc.pms.model.categories.vo.DirectoryInfoVO
;
import
com.mmc.pms.model.categories.vo.DirectoryInfoVO
;
import
com.mmc.pms.model.categories.vo.RelevantBusinessVO
;
import
com.mmc.pms.model.categories.vo.RelevantBusinessVO
;
...
@@ -14,8 +17,10 @@ import io.swagger.annotations.*;
...
@@ -14,8 +17,10 @@ import io.swagger.annotations.*;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.Min
;
import
java.util.List
;
/**
/**
* @Author lw @Date 2023/5/15 13:24 @Version 1.0
* @Author lw @Date 2023/5/15 13:24 @Version 1.0
...
@@ -109,4 +114,11 @@ public class BackstageCategoriesController {
...
@@ -109,4 +114,11 @@ public class BackstageCategoriesController {
return
categoriesService
.
getDirectoryList
(
type
);
return
categoriesService
.
getDirectoryList
(
type
);
}
}
@ApiOperation
(
value
=
"根据类型获取各个目录及分类信息"
)
@GetMapping
(
"queryCategoryInfoByType"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
AllCategoryDTO
.
class
)})
public
ResultBody
queryCategoryInfoByType
(
@ApiParam
(
value
=
"类型:1:作业服务 2:设备 3:培训 4:产品商城"
,
required
=
true
)
@RequestParam
(
value
=
"type"
)
Integer
type
)
{
return
categoriesService
.
queryCategoryInfoByType
(
type
);
}
}
}
src/main/java/com/mmc/pms/controller/BackstageProductSpecController.java
浏览文件 @
a3df433c
...
@@ -12,7 +12,6 @@ import io.swagger.annotations.*;
...
@@ -12,7 +12,6 @@ import io.swagger.annotations.*;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
...
@@ -133,8 +132,7 @@ public class BackstageProductSpecController {
...
@@ -133,8 +132,7 @@ public class BackstageProductSpecController {
// }
// }
@ApiOperation
(
value
=
"feign根据渠道等级获取单价信息"
)
@ApiOperation
(
value
=
"feign根据渠道等级获取单价信息"
)
@GetMapping
(
"feignGetSpecLeaseUnitPrice"
)
@PostMapping
(
"feignGetSpecLeaseUnitPrice"
)
@ApiIgnore
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
BigDecimal
feignGetUnitPriceByTag
(
@RequestBody
PriceAcquisition
priceAcquisition
)
{
public
BigDecimal
feignGetUnitPriceByTag
(
@RequestBody
PriceAcquisition
priceAcquisition
)
{
return
productSkuService
.
feignGetUnitPriceByTag
(
priceAcquisition
);
return
productSkuService
.
feignGetUnitPriceByTag
(
priceAcquisition
);
...
...
src/main/java/com/mmc/pms/controller/BackstageTaskServiceController.java
浏览文件 @
a3df433c
package
com
.
mmc
.
pms
.
controller
;
package
com
.
mmc
.
pms
.
controller
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.model.group.Create
;
import
com.mmc.pms.model.group.Create
;
import
com.mmc.pms.model.group.Update
;
import
com.mmc.pms.model.group.Update
;
import
com.mmc.pms.model.qo.ServiceQO
;
import
com.mmc.pms.model.qo.ServiceQO
;
import
com.mmc.pms.model.work.dto.ServiceDTO
;
import
com.mmc.pms.model.work.vo.ServiceVO
;
import
com.mmc.pms.model.work.vo.ServiceVO
;
import
com.mmc.pms.page.PageResult
;
import
com.mmc.pms.service.BackstageTaskService
;
import
com.mmc.pms.service.BackstageTaskService
;
import
io.swagger.annotations.*
;
import
io.swagger.annotations.*
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
...
@@ -16,48 +17,51 @@ import javax.servlet.http.HttpServletRequest;
...
@@ -16,48 +17,51 @@ import javax.servlet.http.HttpServletRequest;
/**
/**
* @Author LW
* @Author LW
*
@date 2023/6/6 10:41
*
* 概要:
*
@date 2023/6/6 10:41
概要:
*/
*/
@Api
(
tags
=
{
"后台-服务管理-模块"
})
@Api
(
tags
=
{
"后台-服务管理-模块"
})
@RestController
@RestController
@RequestMapping
(
"/backstage/work"
)
@RequestMapping
(
"/backstage/work"
)
public
class
BackstageTaskServiceController
extends
BaseController
{
public
class
BackstageTaskServiceController
extends
BaseController
{
@Resource
@Resource
private
BackstageTaskService
backstageTaskService
;
private
BackstageTaskService
backstageTaskService
;
@ApiOperation
(
value
=
"新增作业服务"
)
@ApiOperation
(
value
=
"新增作业服务"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"addWorkService"
)
@PostMapping
(
"addWorkService"
)
public
ResultBody
addWorkService
(
public
ResultBody
addWorkService
(
@Validated
(
Create
.
class
)
@RequestBody
ServiceVO
param
,
HttpServletRequest
request
)
{
@Validated
(
Create
.
class
)
@RequestBody
ServiceVO
param
,
HttpServletRequest
request
)
{
return
backstageTaskService
.
addWorkService
(
param
,
this
.
getUserLoginInfoFromRedis
(
request
).
getUserAccountId
());
return
backstageTaskService
.
addWorkService
(
}
param
,
this
.
getUserLoginInfoFromRedis
(
request
).
getUserAccountId
());
}
@ApiOperation
(
value
=
"修改作业服务"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@ApiOperation
(
value
=
"修改作业服务"
)
@PostMapping
(
"updateWorkService"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
ResultBody
updateWorkService
(
@Validated
(
Update
.
class
)
@RequestBody
ServiceVO
param
)
{
@PostMapping
(
"updateWorkService"
)
return
backstageTaskService
.
updateById
(
param
);
public
ResultBody
updateWorkService
(
@Validated
(
Update
.
class
)
@RequestBody
ServiceVO
param
)
{
}
return
backstageTaskService
.
updateById
(
param
);
}
@ApiOperation
(
value
=
"删除作业服务"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@ApiOperation
(
value
=
"删除作业服务"
)
@GetMapping
(
"deleteWorkService"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
ResultBody
deleteWorkService
(
@ApiParam
(
"作业服务id"
)
@RequestParam
(
value
=
"id"
)
Integer
id
)
{
@GetMapping
(
"deleteWorkService"
)
return
backstageTaskService
.
deleteById
(
id
);
public
ResultBody
deleteWorkService
(
@ApiParam
(
"作业服务id"
)
@RequestParam
(
value
=
"id"
)
Integer
id
)
{
}
return
backstageTaskService
.
deleteById
(
id
);
}
@ApiOperation
(
value
=
"查询作业服务"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@ApiOperation
(
value
=
"查询作业服务"
)
@GetMapping
(
"queryWorkService"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ServiceDTO
.
class
)})
public
ResultBody
queryWorkService
(
@ApiParam
(
"作业服务id"
)
@RequestParam
(
value
=
"id"
)
Integer
id
)
{
@GetMapping
(
"queryWorkService"
)
return
backstageTaskService
.
queryById
(
id
);
public
ResultBody
queryWorkService
(
@ApiParam
(
"作业服务id"
)
@RequestParam
(
value
=
"id"
)
Integer
id
)
{
}
return
backstageTaskService
.
queryById
(
id
);
}
@ApiOperation
(
value
=
"查询工作服务列表"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@ApiOperation
(
value
=
"查询工作服务列表"
)
@PostMapping
(
"queryWorkServiceList"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ServiceDTO
.
class
)})
public
ResultBody
queryWorkServiceList
(
@Validated
(
Create
.
class
)
@RequestBody
ServiceQO
param
,
HttpServletRequest
request
)
{
@PostMapping
(
"queryWorkServiceList"
)
return
backstageTaskService
.
queryWorkServiceList
(
param
,
this
.
getUserLoginInfoFromRedis
(
request
).
getUserAccountId
());
public
PageResult
queryWorkServiceList
(
}
@Validated
(
Create
.
class
)
@RequestBody
ServiceQO
param
,
HttpServletRequest
request
)
{
return
backstageTaskService
.
queryWorkServiceList
(
param
,
this
.
getUserLoginInfoFromRedis
(
request
).
getUserAccountId
());
}
}
}
src/main/java/com/mmc/pms/controller/BaseController.java
浏览文件 @
a3df433c
...
@@ -11,48 +11,48 @@ import org.springframework.data.redis.core.StringRedisTemplate;
...
@@ -11,48 +11,48 @@ import org.springframework.data.redis.core.StringRedisTemplate;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
/**
/**
* @author: zj
* @author: zj @Date: 2023/5/25 18:11
* @Date: 2023/5/25 18:11
*/
*/
public
abstract
class
BaseController
{
public
abstract
class
BaseController
{
@Autowired
@Autowired
private
StringRedisTemplate
stringRedisTemplate
;
private
StringRedisTemplate
stringRedisTemplate
;
/**
/**
* 解析token,获取用户信息
* 解析token,获取用户信息
* @param request
*
* @return
* @param request
*/
* @return
// public BaseAccountDTO getUserLoginInfo(HttpServletRequest request) {
*/
// String token = request.getHeader("token");
// public BaseAccountDTO getUserLoginInfo(HttpServletRequest request) {
// try {
// String token = request.getHeader("token");
// Claims claims = JwtUtil.parseJwt(token);
// try {
// String userId = claims.get(JwtConstant.USER_ACCOUNT_ID).toString();
// Claims claims = JwtUtil.parseJwt(token);
//// String roleId = claims.get("").toString();
// String userId = claims.get(JwtConstant.USER_ACCOUNT_ID).toString();
// String tokenType = claims.get(JwtConstant.TOKEN_TYPE).toString();
//// String roleId = claims.get("").toString();
// return BaseAccountDTO.builder().id(Integer.parseInt(userId)).tokenPort(tokenType).build();
// String tokenType = claims.get(JwtConstant.TOKEN_TYPE).toString();
// }catch (Exception e){
// return
// throw new BizException("Invalid token");
// BaseAccountDTO.builder().id(Integer.parseInt(userId)).tokenPort(tokenType).build();
// }
// }catch (Exception e){
// }
// throw new BizException("Invalid token");
// }
// }
/**
/**
* 使用token从redis获取用户信息
* 使用token从redis获取用户信息
*
*
* @param request
* @param request
* @return
* @return
*/
*/
public
LoginSuccessDTO
getUserLoginInfoFromRedis
(
HttpServletRequest
request
)
{
public
LoginSuccessDTO
getUserLoginInfoFromRedis
(
HttpServletRequest
request
)
{
String
token
=
request
.
getHeader
(
"token"
);
String
token
=
request
.
getHeader
(
"token"
);
if
(
StringUtils
.
isBlank
(
token
))
{
if
(
StringUtils
.
isBlank
(
token
))
{
throw
new
BizException
(
ResultEnum
.
LOGIN_ACCOUNT_STATUS_ERROR
);
throw
new
BizException
(
ResultEnum
.
LOGIN_ACCOUNT_STATUS_ERROR
);
}
String
json
=
stringRedisTemplate
.
opsForValue
().
get
(
token
);
if
(
StringUtils
.
isBlank
(
json
))
{
throw
new
BizException
(
ResultEnum
.
LOGIN_ACCOUNT_STATUS_ERROR
);
}
LoginSuccessDTO
loginSuccessDTO
=
JSONObject
.
parseObject
(
json
,
LoginSuccessDTO
.
class
);
return
loginSuccessDTO
;
}
}
String
json
=
stringRedisTemplate
.
opsForValue
().
get
(
token
);
if
(
StringUtils
.
isBlank
(
json
))
{
throw
new
BizException
(
ResultEnum
.
LOGIN_ACCOUNT_STATUS_ERROR
);
}
LoginSuccessDTO
loginSuccessDTO
=
JSONObject
.
parseObject
(
json
,
LoginSuccessDTO
.
class
);
return
loginSuccessDTO
;
}
}
}
src/main/java/com/mmc/pms/controller/DirectoryController.java
0 → 100644
浏览文件 @
a3df433c
package
com
.
mmc
.
pms
.
controller
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.entity.Categories
;
import
com.mmc.pms.model.categories.dto.CategoriesDTO
;
import
com.mmc.pms.model.group.Create
;
import
com.mmc.pms.model.qo.ServiceQO
;
import
com.mmc.pms.model.work.dto.ServiceDTO
;
import
com.mmc.pms.page.PageResult
;
import
com.mmc.pms.service.CategoriesService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiResponse
;
import
io.swagger.annotations.ApiResponses
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* <p>
* 前端控制器
* </p>
*
* @author Pika
* @since 2023-06-08
*/
@Api
(
tags
=
{
"后台-目录管理-接口"
})
@RestController
@RequestMapping
(
"/directory"
)
public
class
DirectoryController
{
private
final
String
DIRECTORY_NAME_APPLICATION
=
"应用"
;
private
final
String
DIRECTORY_NAME_INDUSTRY
=
"行业"
;
@Autowired
private
CategoriesService
categoriesService
;
@ApiOperation
(
value
=
"获取应用类型列表"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
CategoriesDTO
.
class
)})
@PostMapping
(
"getApplicationList"
)
public
ResultBody
getApplicationList
()
{
return
categoriesService
.
getApplicationList
(
DIRECTORY_NAME_APPLICATION
);
}
@ApiOperation
(
value
=
"获取对应行业列表"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
CategoriesDTO
.
class
)})
@PostMapping
(
"getIndustryList"
)
public
ResultBody
getIndustryList
()
{
return
categoriesService
.
getApplicationList
(
DIRECTORY_NAME_INDUSTRY
);
}
}
src/main/java/com/mmc/pms/controller/MiniProgramDeviceController.java
浏览文件 @
a3df433c
...
@@ -5,20 +5,16 @@ import com.mmc.pms.common.ResultEnum;
...
@@ -5,20 +5,16 @@ import com.mmc.pms.common.ResultEnum;
import
com.mmc.pms.model.lease.dto.BrandDTO
;
import
com.mmc.pms.model.lease.dto.BrandDTO
;
import
com.mmc.pms.model.lease.dto.DeviceCategoryDTO
;
import
com.mmc.pms.model.lease.dto.DeviceCategoryDTO
;
import
com.mmc.pms.model.lease.dto.WareInfoDTO
;
import
com.mmc.pms.model.lease.dto.WareInfoDTO
;
import
com.mmc.pms.model.lease.dto.WareInfoItemDTO
;
import
com.mmc.pms.model.lease.vo.LeaseVo
;
import
com.mmc.pms.model.lease.vo.LeaseVo
;
import
com.mmc.pms.model.other.dto.DistrictInfoDTO
;
import
com.mmc.pms.model.other.dto.DistrictInfoDTO
;
import
com.mmc.pms.model.other.dto.ModelDTO
;
import
com.mmc.pms.model.other.dto.ModelDTO
;
import
com.mmc.pms.model.qo.WareInfoQO
;
import
com.mmc.pms.model.sale.dto.SkuInfoDTO
;
import
com.mmc.pms.model.sale.dto.SkuInfoDTO
;
import
com.mmc.pms.page.Page
;
import
com.mmc.pms.service.WebDeviceService
;
import
com.mmc.pms.service.WebDeviceService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiResponse
;
import
io.swagger.annotations.ApiResponse
;
import
io.swagger.annotations.ApiResponses
;
import
io.swagger.annotations.ApiResponses
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
/**
/**
...
@@ -57,13 +53,13 @@ public class MiniProgramDeviceController {
...
@@ -57,13 +53,13 @@ public class MiniProgramDeviceController {
return
webDeviceService
.
model
();
return
webDeviceService
.
model
();
}
}
@ApiOperation
(
value
=
"设备列表筛选"
)
//
@ApiOperation(value = "设备列表筛选")
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
WareInfoItemDTO
.
class
)})
//
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = WareInfoItemDTO.class)})
@PostMapping
(
"/deviceList"
)
//
@PostMapping("/deviceList")
public
ResultBody
<
WareInfoItemDTO
>
listWareInfoPage
(
//
public ResultBody<WareInfoItemDTO> listWareInfoPage(
@RequestBody
@Validated
(
Page
.
class
)
WareInfoQO
param
)
{
//
@RequestBody @Validated(Page.class) WareInfoQO param) {
return
webDeviceService
.
listWareInfoPage
(
param
);
// return webDeviceService.listWareInfoPage(param, request
);
}
//
}
@ApiOperation
(
value
=
"设备详情"
)
@ApiOperation
(
value
=
"设备详情"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
...
...
src/main/java/com/mmc/pms/controller/PartUploadController.java
浏览文件 @
a3df433c
...
@@ -32,197 +32,196 @@ import java.util.List;
...
@@ -32,197 +32,196 @@ import java.util.List;
@RequestMapping
(
"/partupload"
)
@RequestMapping
(
"/partupload"
)
public
class
PartUploadController
{
public
class
PartUploadController
{
@Autowired
@Autowired
private
StringRedisTemplate
stringRedisTemplate
;
private
StringRedisTemplate
stringRedisTemplate
;
@ApiOperation
(
value
=
"初始化分片上传"
)
@ApiOperation
(
value
=
"初始化分片上传"
)
@GetMapping
(
"/initPartUpload"
)
@GetMapping
(
"/initPartUpload"
)
public
ResultBody
initPartUpload
(
@RequestParam
String
fileName
,
HttpServletRequest
httpRequest
)
{
public
ResultBody
initPartUpload
(
@RequestParam
String
fileName
,
HttpServletRequest
httpRequest
)
{
// 创建OSSClient实例。
// 创建OSSClient实例。
OSS
ossClient
=
OSS
ossClient
=
new
OSSClientBuilder
()
new
OSSClientBuilder
()
.
build
(
OssConstant
.
ENDPOINT
,
OssConstant
.
ACCESSKEYID
,
OssConstant
.
ACCESSKEYSECRET
);
.
build
(
OssConstant
.
ENDPOINT
,
OssConstant
.
ACCESSKEYID
,
OssConstant
.
ACCESSKEYSECRET
);
StringBuffer
objectName
=
new
StringBuffer
();
StringBuffer
objectName
=
new
StringBuffer
();
objectName
.
append
(
OssConstant
.
BUCKET
);
objectName
.
append
(
OssConstant
.
BUCKET
);
objectName
.
append
(
"/"
);
objectName
.
append
(
"/"
);
objectName
.
append
(
fileName
);
objectName
.
append
(
fileName
);
objectName
.
append
(
"-"
);
objectName
.
append
(
"-"
);
objectName
.
append
(
TDateUtil
.
getCurrentDateByType
(
"yyyyMMddHHmm"
));
objectName
.
append
(
TDateUtil
.
getCurrentDateByType
(
"yyyyMMddHHmm"
));
// 创建InitiateMultipartUploadRequest对象。
// 创建InitiateMultipartUploadRequest对象。
InitiateMultipartUploadRequest
request
=
InitiateMultipartUploadRequest
request
=
new
InitiateMultipartUploadRequest
(
OssConstant
.
BUCKET
,
objectName
.
toString
());
new
InitiateMultipartUploadRequest
(
OssConstant
.
BUCKET
,
objectName
.
toString
());
// 如果需要在初始化分片时设置文件存储类型,请参考以下示例代码。
// 如果需要在初始化分片时设置文件存储类型,请参考以下示例代码。
// ObjectMetadata metadata = new ObjectMetadata();
// ObjectMetadata metadata = new ObjectMetadata();
// metadata.setHeader(OSSHeaders.OSS_STORAGE_CLASS,
// metadata.setHeader(OSSHeaders.OSS_STORAGE_CLASS,
// StorageClass.Standard.toString());
// StorageClass.Standard.toString());
// request.setObjectMetadata(metadata);
// request.setObjectMetadata(metadata);
// 初始化分片。
// 初始化分片。
InitiateMultipartUploadResult
upresult
=
ossClient
.
initiateMultipartUpload
(
request
);
InitiateMultipartUploadResult
upresult
=
ossClient
.
initiateMultipartUpload
(
request
);
// 返回uploadId,它是分片上传事件的唯一标识。您可以根据该uploadId发起相关的操作,例如取消分片上传、查询分片上传等。
// 返回uploadId,它是分片上传事件的唯一标识。您可以根据该uploadId发起相关的操作,例如取消分片上传、查询分片上传等。
String
uploadId
=
upresult
.
getUploadId
();
String
uploadId
=
upresult
.
getUploadId
();
// 记录缓存信息
// 记录缓存信息
PartUploadInfo
pinfo
=
new
PartUploadInfo
();
PartUploadInfo
pinfo
=
new
PartUploadInfo
();
pinfo
.
setBucketName
(
OssConstant
.
BUCKET
);
pinfo
.
setBucketName
(
OssConstant
.
BUCKET
);
pinfo
.
setObjectName
(
objectName
.
toString
());
pinfo
.
setObjectName
(
objectName
.
toString
());
pinfo
.
setUploadId
(
uploadId
);
pinfo
.
setUploadId
(
uploadId
);
stringRedisTemplate
stringRedisTemplate
.
opsForValue
()
.
opsForValue
()
.
set
(
RedisConstant
.
createPartUploadKey
(
uploadId
),
JsonUtil
.
parseObjToJson
(
pinfo
));
.
set
(
RedisConstant
.
createPartUploadKey
(
uploadId
),
JsonUtil
.
parseObjToJson
(
pinfo
));
return
ResultBody
.
success
(
uploadId
);
return
ResultBody
.
success
(
uploadId
);
}
@ApiOperation
(
value
=
"进行片段上传"
)
@PostMapping
(
"/partUpload"
)
public
ResultBody
partUpload
(
@RequestParam
(
"partFile"
)
MultipartFile
partFile
,
@RequestParam
(
"uploadId"
)
String
uploadId
)
throws
IOException
{
PartUploadInfo
pinfo
=
JsonUtil
.
parseJsonToObj
(
stringRedisTemplate
.
opsForValue
().
get
(
RedisConstant
.
createPartUploadKey
(
uploadId
)),
PartUploadInfo
.
class
);
// 创建OSSClient实例。
OSS
ossClient
=
new
OSSClientBuilder
()
.
build
(
OssConstant
.
ENDPOINT
,
OssConstant
.
ACCESSKEYID
,
OssConstant
.
ACCESSKEYSECRET
);
// partETags是PartETag的集合。PartETag由分片的ETag和分片号组成。
List
<
PartETag
>
partETags
=
new
ArrayList
<
PartETag
>();
// 每个分片的大小,用于计算文件有多少个分片。单位为字节。
final
long
partSize
=
1
*
1024
*
1024L
;
// 1 MB。
// 填写本地文件的完整路径。如果未指定本地路径,则默认从示例程序所属项目对应本地路径中上传文件。
final
File
sampleFile
=
new
File
(
"D:\\localpath\\examplefile.txt"
);
long
fileLength
=
sampleFile
.
length
();
int
partCount
=
(
int
)
(
fileLength
/
partSize
);
if
(
fileLength
%
partSize
!=
0
)
{
partCount
++;
}
}
// 遍历分片上传。
@ApiOperation
(
value
=
"进行片段上传"
)
for
(
int
i
=
0
;
i
<
partCount
;
i
++)
{
@PostMapping
(
"/partUpload"
)
long
startPos
=
i
*
partSize
;
public
ResultBody
partUpload
(
long
curPartSize
=
(
i
+
1
==
partCount
)
?
(
fileLength
-
startPos
)
:
partSize
;
@RequestParam
(
"partFile"
)
MultipartFile
partFile
,
@RequestParam
(
"uploadId"
)
String
uploadId
)
InputStream
instream
=
new
FileInputStream
(
sampleFile
);
throws
IOException
{
// 跳过已经上传的分片。
PartUploadInfo
pinfo
=
instream
.
skip
(
startPos
);
JsonUtil
.
parseJsonToObj
(
UploadPartRequest
uploadPartRequest
=
new
UploadPartRequest
();
stringRedisTemplate
.
opsForValue
().
get
(
RedisConstant
.
createPartUploadKey
(
uploadId
)),
uploadPartRequest
.
setBucketName
(
pinfo
.
getBucketName
());
PartUploadInfo
.
class
);
uploadPartRequest
.
setKey
(
pinfo
.
getObjectName
());
// 创建OSSClient实例。
uploadPartRequest
.
setUploadId
(
uploadId
);
OSS
ossClient
=
uploadPartRequest
.
setInputStream
(
instream
);
new
OSSClientBuilder
()
// 设置分片大小。除了最后一个分片没有大小限制,其他的分片最小为100 KB。
.
build
(
OssConstant
.
ENDPOINT
,
OssConstant
.
ACCESSKEYID
,
OssConstant
.
ACCESSKEYSECRET
);
uploadPartRequest
.
setPartSize
(
curPartSize
);
// partETags是PartETag的集合。PartETag由分片的ETag和分片号组成。
// 设置分片号。每一个上传的分片都有一个分片号,取值范围是1~10000,如果超出此范围,OSS将返回InvalidArgument错误码。
List
<
PartETag
>
partETags
=
new
ArrayList
<
PartETag
>();
uploadPartRequest
.
setPartNumber
(
i
+
1
);
// 每个分片的大小,用于计算文件有多少个分片。单位为字节。
// 每个分片不需要按顺序上传,甚至可以在不同客户端上传,OSS会按照分片号排序组成完整的文件。
final
long
partSize
=
1
*
1024
*
1024L
;
// 1 MB。
UploadPartResult
uploadPartResult
=
ossClient
.
uploadPart
(
uploadPartRequest
);
// 每次上传分片之后,OSS的返回结果包含PartETag。PartETag将被保存在partETags中。
// 填写本地文件的完整路径。如果未指定本地路径,则默认从示例程序所属项目对应本地路径中上传文件。
partETags
.
add
(
uploadPartResult
.
getPartETag
());
final
File
sampleFile
=
new
File
(
"D:\\localpath\\examplefile.txt"
);
long
fileLength
=
sampleFile
.
length
();
int
partCount
=
(
int
)
(
fileLength
/
partSize
);
if
(
fileLength
%
partSize
!=
0
)
{
partCount
++;
}
// 遍历分片上传。
for
(
int
i
=
0
;
i
<
partCount
;
i
++)
{
long
startPos
=
i
*
partSize
;
long
curPartSize
=
(
i
+
1
==
partCount
)
?
(
fileLength
-
startPos
)
:
partSize
;
InputStream
instream
=
new
FileInputStream
(
sampleFile
);
// 跳过已经上传的分片。
instream
.
skip
(
startPos
);
UploadPartRequest
uploadPartRequest
=
new
UploadPartRequest
();
uploadPartRequest
.
setBucketName
(
pinfo
.
getBucketName
());
uploadPartRequest
.
setKey
(
pinfo
.
getObjectName
());
uploadPartRequest
.
setUploadId
(
uploadId
);
uploadPartRequest
.
setInputStream
(
instream
);
// 设置分片大小。除了最后一个分片没有大小限制,其他的分片最小为100 KB。
uploadPartRequest
.
setPartSize
(
curPartSize
);
// 设置分片号。每一个上传的分片都有一个分片号,取值范围是1~10000,如果超出此范围,OSS将返回InvalidArgument错误码。
uploadPartRequest
.
setPartNumber
(
i
+
1
);
// 每个分片不需要按顺序上传,甚至可以在不同客户端上传,OSS会按照分片号排序组成完整的文件。
UploadPartResult
uploadPartResult
=
ossClient
.
uploadPart
(
uploadPartRequest
);
// 每次上传分片之后,OSS的返回结果包含PartETag。PartETag将被保存在partETags中。
partETags
.
add
(
uploadPartResult
.
getPartETag
());
}
// 创建CompleteMultipartUploadRequest对象。
// 在执行完成分片上传操作时,需要提供所有有效的partETags。OSS收到提交的partETags后,会逐一验证每个分片的有效性。当所有的数据分片验证通过后,OSS将把这些分片组合成一个完整的文件。
CompleteMultipartUploadRequest
completeMultipartUploadRequest
=
new
CompleteMultipartUploadRequest
(
pinfo
.
getBucketName
(),
pinfo
.
getObjectName
(),
uploadId
,
partETags
);
// 如果需要在完成文件上传的同时设置文件访问权限,请参考以下示例代码。
// completeMultipartUploadRequest.setObjectACL(CannedAccessControlList.PublicRead);
// 完成上传。
CompleteMultipartUploadResult
completeMultipartUploadResult
=
ossClient
.
completeMultipartUpload
(
completeMultipartUploadRequest
);
System
.
out
.
println
(
completeMultipartUploadResult
.
getETag
());
// 关闭OSSClient。
ossClient
.
shutdown
();
return
ResultBody
.
success
();
}
}
@ApiOperation
(
value
=
"上传到阿里云oss"
)
// 创建CompleteMultipartUploadRequest对象。
@PostMapping
(
"/oss"
)
// 在执行完成分片上传操作时,需要提供所有有效的partETags。OSS收到提交的partETags后,会逐一验证每个分片的有效性。当所有的数据分片验证通过后,OSS将把这些分片组合成一个完整的文件。
public
ResultBody
oss
(
CompleteMultipartUploadRequest
completeMultipartUploadRequest
=
@RequestPart
(
"uploadFile"
)
MultipartFile
uploadFile
,
HttpServletRequest
httpRequest
)
new
CompleteMultipartUploadRequest
(
throws
Exception
{
pinfo
.
getBucketName
(),
pinfo
.
getObjectName
(),
uploadId
,
partETags
);
// yourEndpoint填写Bucket所在地域对应的Endpoint。以华东1(杭州)为例,Endpoint填写为https://oss-cn-hangzhou.aliyuncs.com。
String
endpoint
=
"yourEndpoint"
;
// 如果需要在完成文件上传的同时设置文件访问权限,请参考以下示例代码。
// 阿里云账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM用户进行API访问或日常运维,请登录RAM控制台创建RAM用户。
// completeMultipartUploadRequest.setObjectACL(CannedAccessControlList.PublicRead);
String
accessKeyId
=
"yourAccessKeyId"
;
String
accessKeySecret
=
"yourAccessKeySecret"
;
// 完成上传。
CompleteMultipartUploadResult
completeMultipartUploadResult
=
// 填写Bucket名称,例如examplebucket。
ossClient
.
completeMultipartUpload
(
completeMultipartUploadRequest
);
String
bucketName
=
"examplebucket"
;
System
.
out
.
println
(
completeMultipartUploadResult
.
getETag
());
// 填写Object完整路径,例如exampledir/exampleobject.txt。Object完整路径中不能包含Bucket名称。
// 关闭OSSClient。
String
objectName
=
"exampledir/exampleobject.txt"
;
ossClient
.
shutdown
();
return
ResultBody
.
success
();
// 创建OSSClient实例。
}
OSS
ossClient
=
new
OSSClientBuilder
().
build
(
endpoint
,
accessKeyId
,
accessKeySecret
);
@ApiOperation
(
value
=
"上传到阿里云oss"
)
// 创建InitiateMultipartUploadRequest对象。
@PostMapping
(
"/oss"
)
InitiateMultipartUploadRequest
request
=
public
ResultBody
oss
(
new
InitiateMultipartUploadRequest
(
bucketName
,
objectName
);
@RequestPart
(
"uploadFile"
)
MultipartFile
uploadFile
,
HttpServletRequest
httpRequest
)
throws
Exception
{
// 如果需要在初始化分片时设置文件存储类型,请参考以下示例代码。
// yourEndpoint填写Bucket所在地域对应的Endpoint。以华东1(杭州)为例,Endpoint填写为https://oss-cn-hangzhou.aliyuncs.com。
// ObjectMetadata metadata = new ObjectMetadata();
String
endpoint
=
"yourEndpoint"
;
// metadata.setHeader(OSSHeaders.OSS_STORAGE_CLASS,
// 阿里云账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM用户进行API访问或日常运维,请登录RAM控制台创建RAM用户。
// StorageClass.Standard.toString());
String
accessKeyId
=
"yourAccessKeyId"
;
// request.setObjectMetadata(metadata);
String
accessKeySecret
=
"yourAccessKeySecret"
;
// 初始化分片。
// 填写Bucket名称,例如examplebucket。
InitiateMultipartUploadResult
upresult
=
ossClient
.
initiateMultipartUpload
(
request
);
String
bucketName
=
"examplebucket"
;
// 返回uploadId,它是分片上传事件的唯一标识。您可以根据该uploadId发起相关的操作,例如取消分片上传、查询分片上传等。
// 填写Object完整路径,例如exampledir/exampleobject.txt。Object完整路径中不能包含Bucket名称。
String
uploadId
=
upresult
.
getUploadId
();
String
objectName
=
"exampledir/exampleobject.txt"
;
// partETags是PartETag的集合。PartETag由分片的ETag和分片号组成。
// 创建OSSClient实例。
List
<
PartETag
>
partETags
=
new
ArrayList
<
PartETag
>();
OSS
ossClient
=
new
OSSClientBuilder
().
build
(
endpoint
,
accessKeyId
,
accessKeySecret
);
// 每个分片的大小,用于计算文件有多少个分片。单位为字节。
final
long
partSize
=
1
*
1024
*
1024L
;
// 1 MB。
// 创建InitiateMultipartUploadRequest对象。
InitiateMultipartUploadRequest
request
=
// 填写本地文件的完整路径。如果未指定本地路径,则默认从示例程序所属项目对应本地路径中上传文件。
new
InitiateMultipartUploadRequest
(
bucketName
,
objectName
);
final
File
sampleFile
=
new
File
(
"D:\\localpath\\examplefile.txt"
);
long
fileLength
=
sampleFile
.
length
();
// 如果需要在初始化分片时设置文件存储类型,请参考以下示例代码。
int
partCount
=
(
int
)
(
fileLength
/
partSize
);
// ObjectMetadata metadata = new ObjectMetadata();
if
(
fileLength
%
partSize
!=
0
)
{
// metadata.setHeader(OSSHeaders.OSS_STORAGE_CLASS,
partCount
++;
// StorageClass.Standard.toString());
}
// request.setObjectMetadata(metadata);
// 遍历分片上传。
for
(
int
i
=
0
;
i
<
partCount
;
i
++)
{
// 初始化分片。
long
startPos
=
i
*
partSize
;
InitiateMultipartUploadResult
upresult
=
ossClient
.
initiateMultipartUpload
(
request
);
long
curPartSize
=
(
i
+
1
==
partCount
)
?
(
fileLength
-
startPos
)
:
partSize
;
// 返回uploadId,它是分片上传事件的唯一标识。您可以根据该uploadId发起相关的操作,例如取消分片上传、查询分片上传等。
InputStream
instream
=
new
FileInputStream
(
sampleFile
);
String
uploadId
=
upresult
.
getUploadId
();
// 跳过已经上传的分片。
instream
.
skip
(
startPos
);
// partETags是PartETag的集合。PartETag由分片的ETag和分片号组成。
UploadPartRequest
uploadPartRequest
=
new
UploadPartRequest
();
List
<
PartETag
>
partETags
=
new
ArrayList
<
PartETag
>();
uploadPartRequest
.
setBucketName
(
bucketName
);
// 每个分片的大小,用于计算文件有多少个分片。单位为字节。
uploadPartRequest
.
setKey
(
objectName
);
final
long
partSize
=
1
*
1024
*
1024L
;
// 1 MB。
uploadPartRequest
.
setUploadId
(
uploadId
);
uploadPartRequest
.
setInputStream
(
instream
);
// 填写本地文件的完整路径。如果未指定本地路径,则默认从示例程序所属项目对应本地路径中上传文件。
// 设置分片大小。除了最后一个分片没有大小限制,其他的分片最小为100 KB。
final
File
sampleFile
=
new
File
(
"D:\\localpath\\examplefile.txt"
);
uploadPartRequest
.
setPartSize
(
curPartSize
);
long
fileLength
=
sampleFile
.
length
();
// 设置分片号。每一个上传的分片都有一个分片号,取值范围是1~10000,如果超出此范围,OSS将返回InvalidArgument错误码。
int
partCount
=
(
int
)
(
fileLength
/
partSize
);
uploadPartRequest
.
setPartNumber
(
i
+
1
);
if
(
fileLength
%
partSize
!=
0
)
{
// 每个分片不需要按顺序上传,甚至可以在不同客户端上传,OSS会按照分片号排序组成完整的文件。
partCount
++;
UploadPartResult
uploadPartResult
=
ossClient
.
uploadPart
(
uploadPartRequest
);
}
// 每次上传分片之后,OSS的返回结果包含PartETag。PartETag将被保存在partETags中。
// 遍历分片上传。
partETags
.
add
(
uploadPartResult
.
getPartETag
());
for
(
int
i
=
0
;
i
<
partCount
;
i
++)
{
}
long
startPos
=
i
*
partSize
;
long
curPartSize
=
(
i
+
1
==
partCount
)
?
(
fileLength
-
startPos
)
:
partSize
;
// 创建CompleteMultipartUploadRequest对象。
InputStream
instream
=
new
FileInputStream
(
sampleFile
);
// 在执行完成分片上传操作时,需要提供所有有效的partETags。OSS收到提交的partETags后,会逐一验证每个分片的有效性。当所有的数据分片验证通过后,OSS将把这些分片组合成一个完整的文件。
// 跳过已经上传的分片。
CompleteMultipartUploadRequest
completeMultipartUploadRequest
=
instream
.
skip
(
startPos
);
new
CompleteMultipartUploadRequest
(
bucketName
,
objectName
,
uploadId
,
partETags
);
UploadPartRequest
uploadPartRequest
=
new
UploadPartRequest
();
uploadPartRequest
.
setBucketName
(
bucketName
);
// 如果需要在完成文件上传的同时设置文件访问权限,请参考以下示例代码。
uploadPartRequest
.
setKey
(
objectName
);
// completeMultipartUploadRequest.setObjectACL(CannedAccessControlList.PublicRead);
uploadPartRequest
.
setUploadId
(
uploadId
);
uploadPartRequest
.
setInputStream
(
instream
);
// 完成上传。
// 设置分片大小。除了最后一个分片没有大小限制,其他的分片最小为100 KB。
CompleteMultipartUploadResult
completeMultipartUploadResult
=
uploadPartRequest
.
setPartSize
(
curPartSize
);
ossClient
.
completeMultipartUpload
(
completeMultipartUploadRequest
);
// 设置分片号。每一个上传的分片都有一个分片号,取值范围是1~10000,如果超出此范围,OSS将返回InvalidArgument错误码。
System
.
out
.
println
(
completeMultipartUploadResult
.
getETag
());
uploadPartRequest
.
setPartNumber
(
i
+
1
);
// 关闭OSSClient。
// 每个分片不需要按顺序上传,甚至可以在不同客户端上传,OSS会按照分片号排序组成完整的文件。
ossClient
.
shutdown
();
UploadPartResult
uploadPartResult
=
ossClient
.
uploadPart
(
uploadPartRequest
);
return
ResultBody
.
success
();
// 每次上传分片之后,OSS的返回结果包含PartETag。PartETag将被保存在partETags中。
partETags
.
add
(
uploadPartResult
.
getPartETag
());
}
}
// 创建CompleteMultipartUploadRequest对象。
// 在执行完成分片上传操作时,需要提供所有有效的partETags。OSS收到提交的partETags后,会逐一验证每个分片的有效性。当所有的数据分片验证通过后,OSS将把这些分片组合成一个完整的文件。
CompleteMultipartUploadRequest
completeMultipartUploadRequest
=
new
CompleteMultipartUploadRequest
(
bucketName
,
objectName
,
uploadId
,
partETags
);
// 如果需要在完成文件上传的同时设置文件访问权限,请参考以下示例代码。
// completeMultipartUploadRequest.setObjectACL(CannedAccessControlList.PublicRead);
// 完成上传。
CompleteMultipartUploadResult
completeMultipartUploadResult
=
ossClient
.
completeMultipartUpload
(
completeMultipartUploadRequest
);
System
.
out
.
println
(
completeMultipartUploadResult
.
getETag
());
// 关闭OSSClient。
ossClient
.
shutdown
();
return
ResultBody
.
success
();
}
}
}
src/main/java/com/mmc/pms/controller/UploadController.java
浏览文件 @
a3df433c
...
@@ -30,527 +30,527 @@ import java.util.*;
...
@@ -30,527 +30,527 @@ import java.util.*;
@RestController
@RestController
@RequestMapping
(
"/upload"
)
@RequestMapping
(
"/upload"
)
public
class
UploadController
{
public
class
UploadController
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy/MM/dd/"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy/MM/dd/"
);
@ApiOperation
(
value
=
"V1.0.1-上传一个图片或者文件到阿里云oss"
)
@ApiOperation
(
value
=
"V1.0.1-上传一个图片或者文件到阿里云oss"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
@ApiImplicitParam
(
paramType
=
"header"
,
paramType
=
"header"
,
name
=
"mmc-identity"
,
name
=
"mmc-identity"
,
dataTypeClass
=
java
.
lang
.
String
.
class
,
dataTypeClass
=
java
.
lang
.
String
.
class
,
dataType
=
"String"
,
dataType
=
"String"
,
required
=
false
,
required
=
false
,
value
=
"token"
),
value
=
"token"
),
@ApiImplicitParam
(
@ApiImplicitParam
(
name
=
"uploadFile"
,
name
=
"uploadFile"
,
dataType
=
"MultipartFile"
,
dataType
=
"MultipartFile"
,
dataTypeClass
=
org
.
springframework
.
web
.
multipart
.
MultipartFile
.
class
,
dataTypeClass
=
org
.
springframework
.
web
.
multipart
.
MultipartFile
.
class
,
required
=
true
,
required
=
true
,
value
=
"文件/图片/后缀无限制"
),
value
=
"文件/图片/后缀无限制"
),
})
})
@PostMapping
(
"/oss"
)
@PostMapping
(
"/oss"
)
public
ResultBody
oss
(
public
ResultBody
oss
(
@RequestParam
(
"uploadFile"
)
MultipartFile
uploadFile
,
HttpServletRequest
request
)
{
@RequestParam
(
"uploadFile"
)
MultipartFile
uploadFile
,
HttpServletRequest
request
)
{
OSS
ossClient
=
OSS
ossClient
=
new
OSSClientBuilder
()
new
OSSClientBuilder
()
.
build
(
OssConstant
.
ENDPOINT
,
OssConstant
.
ACCESSKEYID
,
OssConstant
.
ACCESSKEYSECRET
);
.
build
(
OssConstant
.
ENDPOINT
,
OssConstant
.
ACCESSKEYID
,
OssConstant
.
ACCESSKEYSECRET
);
InputStream
inputStream
=
null
;
try
{
inputStream
=
uploadFile
.
getInputStream
();
}
catch
(
IOException
e
)
{
return
ResultBody
.
error
(
e
.
getMessage
());
}
String
oldName
=
uploadFile
.
getOriginalFilename
();
String
newName
=
"file/"
+
UUID
.
randomUUID
().
toString
()
+
oldName
.
substring
(
oldName
.
lastIndexOf
(
"."
),
oldName
.
length
());
ossClient
.
putObject
(
OssConstant
.
BUCKET
,
newName
,
inputStream
);
ossClient
.
shutdown
();
String
filePath
=
"https://"
+
OssConstant
.
BUCKET
+
'.'
+
OssConstant
.
ENDPOINT
+
"/"
+
newName
;
JSONObject
jsObj
=
new
JSONObject
();
jsObj
.
put
(
"filePath"
,
filePath
);
return
ResultBody
.
success
(
jsObj
);
}
@ApiOperation
(
value
=
"V1.0.1-上传多个文件到阿里云oss"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"header"
,
name
=
"mmc-identity"
,
dataTypeClass
=
java
.
lang
.
String
.
class
,
dataType
=
"String"
,
required
=
false
,
value
=
"token"
),
@ApiImplicitParam
(
name
=
"uploadFile"
,
dataType
=
"MultipartFile"
,
dataTypeClass
=
org
.
springframework
.
web
.
multipart
.
MultipartFile
.
class
,
required
=
true
,
value
=
"文件/图片"
),
})
@PostMapping
(
"/osses"
)
public
ResultBody
osses
(
@RequestParam
(
"uploadFile"
)
MultipartFile
[]
uploadFile
,
HttpServletRequest
request
)
throws
IOException
{
OSS
ossClient
=
new
OSSClientBuilder
()
.
build
(
OssConstant
.
ENDPOINT
,
OssConstant
.
ACCESSKEYID
,
OssConstant
.
ACCESSKEYSECRET
);
List
list
=
new
LinkedList
();
if
(
uploadFile
!=
null
&&
uploadFile
.
length
>
0
)
{
System
.
out
.
println
(
"osses文件数量"
+
uploadFile
.
length
);
for
(
int
i
=
0
;
i
<
uploadFile
.
length
;
i
++)
{
MultipartFile
file
=
uploadFile
[
i
];
InputStream
inputStream
=
null
;
InputStream
inputStream
=
null
;
try
{
try
{
inputStream
=
uploadF
ile
.
getInputStream
();
inputStream
=
f
ile
.
getInputStream
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
return
ResultBody
.
error
(
e
.
getMessage
());
return
ResultBody
.
error
(
e
.
getMessage
());
}
}
String
oldName
=
uploadFile
.
getOriginalFilename
();
String
oldName
=
file
.
getOriginalFilename
();
String
newName
=
String
newName
=
"file/"
"file/"
+
UUID
.
randomUUID
().
toString
()
+
UUID
.
randomUUID
().
toString
()
+
oldName
.
substring
(
oldName
.
lastIndexOf
(
"."
),
oldName
.
length
());
+
oldName
.
substring
(
oldName
.
lastIndexOf
(
"."
),
oldName
.
length
());
ossClient
.
putObject
(
OssConstant
.
BUCKET
,
newName
,
inputStream
);
ossClient
.
putObject
(
OssConstant
.
BUCKET
,
newName
,
inputStream
);
ossClient
.
shutdown
();
// ossClient.shutdown();
String
filePath
=
"https://"
+
OssConstant
.
BUCKET
+
'.'
+
OssConstant
.
ENDPOINT
+
"/"
+
newName
;
// String filePath = "https://" + OssConstant.BUCKET + '.' +
JSONObject
jsObj
=
new
JSONObject
();
// OssConstant.ENDPOINT + "/" +
jsObj
.
put
(
"filePath"
,
filePath
);
// newName;
return
ResultBody
.
success
(
jsObj
);
list
.
add
(
"https://"
+
OssConstant
.
BUCKET
+
'.'
+
OssConstant
.
ENDPOINT
+
"/"
+
newName
);
}
}
}
ossClient
.
shutdown
();
// 关流
return
ResultBody
.
success
(
list
);
}
@ApiOperation
(
value
=
"V1.0.1-上传多个文件到阿里云oss"
)
@ApiOperation
(
value
=
"V1.0.1-上传多个视频文件到阿里云oss"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
@ApiImplicitParam
(
paramType
=
"header"
,
paramType
=
"header"
,
name
=
"mmc-identity"
,
name
=
"mmc-identity"
,
dataTypeClass
=
java
.
lang
.
String
.
class
,
dataTypeClass
=
java
.
lang
.
String
.
class
,
dataType
=
"String"
,
dataType
=
"String"
,
required
=
false
,
required
=
false
,
value
=
"token"
),
value
=
"token"
),
@ApiImplicitParam
(
@ApiImplicitParam
(
name
=
"uploadFile"
,
name
=
"uploadFile"
,
dataType
=
"MultipartFile"
,
dataType
=
"MultipartFile"
,
dataTypeClass
=
org
.
springframework
.
web
.
multipart
.
MultipartFile
.
class
,
dataTypeClass
=
org
.
springframework
.
web
.
multipart
.
MultipartFile
.
class
,
required
=
true
,
required
=
true
,
value
=
"文件/图片"
),
value
=
"视频不能超过1MB/mkv/avi/mov/mp4"
),
})
})
@PostMapping
(
"/osses"
)
@PostMapping
(
"/videoOss"
)
public
ResultBody
osses
(
public
ResultBody
videoOss
(
@RequestParam
(
"uploadFile"
)
MultipartFile
[]
uploadFile
,
HttpServletRequest
request
)
@RequestParam
(
"uploadFile"
)
MultipartFile
[]
uploadFile
,
HttpServletRequest
request
)
throws
IOException
{
throws
IOException
{
OSS
ossClient
=
ClientBuilderConfiguration
clientBuilderConfiguration
=
new
ClientBuilderConfiguration
();
new
OSSClientBuilder
()
clientBuilderConfiguration
.
setRequestTimeoutEnabled
(
true
);
.
build
(
OssConstant
.
ENDPOINT
,
OssConstant
.
ACCESSKEYID
,
OssConstant
.
ACCESSKEYSECRET
);
clientBuilderConfiguration
.
setConnectionRequestTimeout
(
600000
*
20
);
List
list
=
new
LinkedList
();
clientBuilderConfiguration
.
setConnectionTimeout
(
600000
*
20
);
if
(
uploadFile
!=
null
&&
uploadFile
.
length
>
0
)
{
System
.
out
.
println
(
"osses文件数量"
+
uploadFile
.
length
);
for
(
int
i
=
0
;
i
<
uploadFile
.
length
;
i
++)
{
MultipartFile
file
=
uploadFile
[
i
];
InputStream
inputStream
=
null
;
try
{
inputStream
=
file
.
getInputStream
();
}
catch
(
IOException
e
)
{
return
ResultBody
.
error
(
e
.
getMessage
());
OSS
ossClient
=
}
new
OSSClientBuilder
()
String
oldName
=
file
.
getOriginalFilename
();
.
build
(
OssConstant
.
ENDPOINT
,
String
newName
=
OssConstant
.
ACCESSKEYID
,
"file/"
OssConstant
.
ACCESSKEYSECRET
,
+
UUID
.
randomUUID
().
toString
()
clientBuilderConfiguration
);
+
oldName
.
substring
(
oldName
.
lastIndexOf
(
"."
),
oldName
.
length
());
List
list
=
new
LinkedList
();
ossClient
.
putObject
(
OssConstant
.
BUCKET
,
newName
,
inputStream
);
if
(
uploadFile
!=
null
&&
uploadFile
.
length
>
0
)
{
// ossClient.shutdown();
System
.
out
.
println
(
"osses文件数量"
+
uploadFile
.
length
);
// String filePath = "https://" + OssConstant.BUCKET + '.' +
for
(
int
i
=
0
;
i
<
uploadFile
.
length
;
i
++)
{
// OssConstant.ENDPOINT + "/" +
MultipartFile
file
=
uploadFile
[
i
];
// newName;
InputStream
inputStream
=
null
;
list
.
add
(
"https://"
+
OssConstant
.
BUCKET
+
'.'
+
OssConstant
.
ENDPOINT
+
"/"
+
newName
);
try
{
}
inputStream
=
file
.
getInputStream
();
}
catch
(
IOException
e
)
{
return
ResultBody
.
error
(
e
.
getMessage
());
}
}
ossClient
.
shutdown
();
// 关流
try
(
final
BufferedInputStream
bis
=
new
BufferedInputStream
(
inputStream
))
{
return
ResultBody
.
success
(
list
);
// 校验
}
int
typeNum
=
FileLoadUtil
.
checkFileType
(
FileLoadUtil
.
getType
(
bis
));
if
(
typeNum
!=
3
)
{
@ApiOperation
(
value
=
"V1.0.1-上传多个视频文件到阿里云oss"
)
return
ResultBody
.
error
(
ResultEnum
.
UPLOAD_VIDEO_ERROR
);
@ApiImplicitParams
({
}
@ApiImplicitParam
(
String
oldName
=
file
.
getOriginalFilename
();
paramType
=
"header"
,
String
newName
=
name
=
"mmc-identity"
,
"file/"
dataTypeClass
=
java
.
lang
.
String
.
class
,
+
UUID
.
randomUUID
().
toString
()
dataType
=
"String"
,
+
oldName
.
substring
(
oldName
.
lastIndexOf
(
"."
),
oldName
.
length
());
required
=
false
,
ossClient
.
putObject
(
OssConstant
.
BUCKET
,
newName
,
bis
);
value
=
"token"
),
System
.
out
.
println
(
"视频名称:"
+
newName
);
@ApiImplicitParam
(
list
.
add
(
"https://"
+
OssConstant
.
BUCKET
+
'.'
+
OssConstant
.
ENDPOINT
+
"/"
+
newName
);
name
=
"uploadFile"
,
dataType
=
"MultipartFile"
,
dataTypeClass
=
org
.
springframework
.
web
.
multipart
.
MultipartFile
.
class
,
required
=
true
,
value
=
"视频不能超过1MB/mkv/avi/mov/mp4"
),
})
@PostMapping
(
"/videoOss"
)
public
ResultBody
videoOss
(
@RequestParam
(
"uploadFile"
)
MultipartFile
[]
uploadFile
,
HttpServletRequest
request
)
throws
IOException
{
ClientBuilderConfiguration
clientBuilderConfiguration
=
new
ClientBuilderConfiguration
();
clientBuilderConfiguration
.
setRequestTimeoutEnabled
(
true
);
clientBuilderConfiguration
.
setConnectionRequestTimeout
(
600000
*
20
);
clientBuilderConfiguration
.
setConnectionTimeout
(
600000
*
20
);
OSS
ossClient
=
new
OSSClientBuilder
()
.
build
(
OssConstant
.
ENDPOINT
,
OssConstant
.
ACCESSKEYID
,
OssConstant
.
ACCESSKEYSECRET
,
clientBuilderConfiguration
);
List
list
=
new
LinkedList
();
if
(
uploadFile
!=
null
&&
uploadFile
.
length
>
0
)
{
System
.
out
.
println
(
"osses文件数量"
+
uploadFile
.
length
);
for
(
int
i
=
0
;
i
<
uploadFile
.
length
;
i
++)
{
MultipartFile
file
=
uploadFile
[
i
];
InputStream
inputStream
=
null
;
try
{
inputStream
=
file
.
getInputStream
();
}
catch
(
IOException
e
)
{
return
ResultBody
.
error
(
e
.
getMessage
());
}
try
(
final
BufferedInputStream
bis
=
new
BufferedInputStream
(
inputStream
))
{
// 校验
int
typeNum
=
FileLoadUtil
.
checkFileType
(
FileLoadUtil
.
getType
(
bis
));
if
(
typeNum
!=
3
)
{
return
ResultBody
.
error
(
ResultEnum
.
UPLOAD_VIDEO_ERROR
);
}
String
oldName
=
file
.
getOriginalFilename
();
String
newName
=
"file/"
+
UUID
.
randomUUID
().
toString
()
+
oldName
.
substring
(
oldName
.
lastIndexOf
(
"."
),
oldName
.
length
());
ossClient
.
putObject
(
OssConstant
.
BUCKET
,
newName
,
bis
);
System
.
out
.
println
(
"视频名称:"
+
newName
);
list
.
add
(
"https://"
+
OssConstant
.
BUCKET
+
'.'
+
OssConstant
.
ENDPOINT
+
"/"
+
newName
);
}
}
}
}
ossClient
.
shutdown
();
// 关流
}
return
ResultBody
.
success
(
list
);
}
}
ossClient
.
shutdown
();
// 关流
return
ResultBody
.
success
(
list
);
}
@ApiOperation
(
value
=
"V1.0.1-上传一个视频文件到阿里云oss"
)
@ApiOperation
(
value
=
"V1.0.1-上传一个视频文件到阿里云oss"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
@ApiImplicitParam
(
paramType
=
"header"
,
paramType
=
"header"
,
name
=
"mmc-identity"
,
name
=
"mmc-identity"
,
dataTypeClass
=
java
.
lang
.
String
.
class
,
dataTypeClass
=
java
.
lang
.
String
.
class
,
dataType
=
"String"
,
dataType
=
"String"
,
required
=
false
,
required
=
false
,
value
=
"token"
),
value
=
"token"
),
@ApiImplicitParam
(
@ApiImplicitParam
(
name
=
"uploadFile"
,
name
=
"uploadFile"
,
dataType
=
"MultipartFile"
,
dataType
=
"MultipartFile"
,
dataTypeClass
=
org
.
springframework
.
web
.
multipart
.
MultipartFile
.
class
,
dataTypeClass
=
org
.
springframework
.
web
.
multipart
.
MultipartFile
.
class
,
required
=
true
,
required
=
true
,
value
=
"视频不能超过1MB/mkv/avi/mov/mp4"
),
value
=
"视频不能超过1MB/mkv/avi/mov/mp4"
),
})
})
@PostMapping
(
"/videoOsses"
)
@PostMapping
(
"/videoOsses"
)
public
ResultBody
videoOsses
(
public
ResultBody
videoOsses
(
@RequestParam
(
"uploadFile"
)
MultipartFile
[]
uploadFile
,
HttpServletRequest
request
)
@RequestParam
(
"uploadFile"
)
MultipartFile
[]
uploadFile
,
HttpServletRequest
request
)
throws
IOException
{
throws
IOException
{
ClientBuilderConfiguration
clientBuilderConfiguration
=
new
ClientBuilderConfiguration
();
ClientBuilderConfiguration
clientBuilderConfiguration
=
new
ClientBuilderConfiguration
();
clientBuilderConfiguration
.
setRequestTimeoutEnabled
(
true
);
clientBuilderConfiguration
.
setRequestTimeoutEnabled
(
true
);
clientBuilderConfiguration
.
setConnectionRequestTimeout
(
600000
*
20
);
clientBuilderConfiguration
.
setConnectionRequestTimeout
(
600000
*
20
);
clientBuilderConfiguration
.
setConnectionTimeout
(
600000
*
20
);
clientBuilderConfiguration
.
setConnectionTimeout
(
600000
*
20
);
OSS
ossClient
=
OSS
ossClient
=
new
OSSClientBuilder
()
new
OSSClientBuilder
()
.
build
(
.
build
(
OssConstant
.
ENDPOINT
,
OssConstant
.
ENDPOINT
,
OssConstant
.
ACCESSKEYID
,
OssConstant
.
ACCESSKEYID
,
OssConstant
.
ACCESSKEYSECRET
,
OssConstant
.
ACCESSKEYSECRET
,
clientBuilderConfiguration
);
clientBuilderConfiguration
);
Map
map
=
new
HashMap
();
Map
map
=
new
HashMap
();
if
(
uploadFile
!=
null
&&
uploadFile
.
length
>
0
)
{
if
(
uploadFile
!=
null
&&
uploadFile
.
length
>
0
)
{
System
.
out
.
println
(
"osses文件数量"
+
uploadFile
.
length
);
System
.
out
.
println
(
"osses文件数量"
+
uploadFile
.
length
);
for
(
int
i
=
0
;
i
<
uploadFile
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
uploadFile
.
length
;
i
++)
{
MultipartFile
file
=
uploadFile
[
i
];
MultipartFile
file
=
uploadFile
[
i
];
InputStream
inputStream
=
null
;
InputStream
inputStream
=
null
;
try
{
try
{
inputStream
=
file
.
getInputStream
();
inputStream
=
file
.
getInputStream
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
return
ResultBody
.
error
(
e
.
getMessage
());
return
ResultBody
.
error
(
e
.
getMessage
());
}
try
(
final
BufferedInputStream
bis
=
new
BufferedInputStream
(
inputStream
))
{
// 校验
int
typeNum
=
FileLoadUtil
.
checkFileType
(
FileLoadUtil
.
getType
(
bis
));
if
(
typeNum
!=
3
)
{
return
ResultBody
.
error
(
ResultEnum
.
UPLOAD_VIDEO_ERROR
);
}
String
oldName
=
file
.
getOriginalFilename
();
String
newName
=
"file/"
+
UUID
.
randomUUID
().
toString
()
+
oldName
.
substring
(
oldName
.
lastIndexOf
(
"."
),
oldName
.
length
());
ossClient
.
putObject
(
OssConstant
.
BUCKET
,
newName
,
bis
);
System
.
out
.
println
(
"视频名称:"
+
newName
);
map
.
put
(
"filePath"
,
"https://"
+
OssConstant
.
BUCKET
+
'.'
+
OssConstant
.
ENDPOINT
+
"/"
+
newName
);
map
.
put
(
"fileName"
,
oldName
);
map
.
put
(
"fileSize"
,
file
.
getSize
());
map
.
put
(
"fileType"
,
oldName
.
substring
(
oldName
.
lastIndexOf
(
"."
)).
replace
(
"."
,
""
));
}
}
}
}
ossClient
.
shutdown
();
// 关流
try
(
final
BufferedInputStream
bis
=
new
BufferedInputStream
(
inputStream
))
{
return
ResultBody
.
success
(
map
);
// 校验
int
typeNum
=
FileLoadUtil
.
checkFileType
(
FileLoadUtil
.
getType
(
bis
));
if
(
typeNum
!=
3
)
{
return
ResultBody
.
error
(
ResultEnum
.
UPLOAD_VIDEO_ERROR
);
}
String
oldName
=
file
.
getOriginalFilename
();
String
newName
=
"file/"
+
UUID
.
randomUUID
().
toString
()
+
oldName
.
substring
(
oldName
.
lastIndexOf
(
"."
),
oldName
.
length
());
ossClient
.
putObject
(
OssConstant
.
BUCKET
,
newName
,
bis
);
System
.
out
.
println
(
"视频名称:"
+
newName
);
map
.
put
(
"filePath"
,
"https://"
+
OssConstant
.
BUCKET
+
'.'
+
OssConstant
.
ENDPOINT
+
"/"
+
newName
);
map
.
put
(
"fileName"
,
oldName
);
map
.
put
(
"fileSize"
,
file
.
getSize
());
map
.
put
(
"fileType"
,
oldName
.
substring
(
oldName
.
lastIndexOf
(
"."
)).
replace
(
"."
,
""
));
}
}
}
}
ossClient
.
shutdown
();
// 关流
return
ResultBody
.
success
(
map
);
}
@ApiOperation
(
value
=
"V1.0.1-上传多张图片文件到阿里云oss"
)
@ApiOperation
(
value
=
"V1.0.1-上传多张图片文件到阿里云oss"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
@ApiImplicitParam
(
paramType
=
"header"
,
paramType
=
"header"
,
name
=
"mmc-identity"
,
name
=
"mmc-identity"
,
dataTypeClass
=
java
.
lang
.
String
.
class
,
dataTypeClass
=
java
.
lang
.
String
.
class
,
dataType
=
"String"
,
dataType
=
"String"
,
required
=
false
,
required
=
false
,
value
=
"token"
),
value
=
"token"
),
@ApiImplicitParam
(
@ApiImplicitParam
(
name
=
"uploadFile"
,
name
=
"uploadFile"
,
dataType
=
"MultipartFile"
,
dataType
=
"MultipartFile"
,
dataTypeClass
=
org
.
springframework
.
web
.
multipart
.
MultipartFile
.
class
,
dataTypeClass
=
org
.
springframework
.
web
.
multipart
.
MultipartFile
.
class
,
required
=
true
,
required
=
true
,
value
=
"图片"
),
value
=
"图片"
),
})
})
@PostMapping
(
"/imgOss"
)
@PostMapping
(
"/imgOss"
)
public
ResultBody
imgOss
(
public
ResultBody
imgOss
(
@RequestParam
(
"uploadFile"
)
MultipartFile
[]
uploadFile
,
HttpServletRequest
request
)
@RequestParam
(
"uploadFile"
)
MultipartFile
[]
uploadFile
,
HttpServletRequest
request
)
throws
IOException
{
throws
IOException
{
OSS
ossClient
=
OSS
ossClient
=
new
OSSClientBuilder
()
new
OSSClientBuilder
()
.
build
(
OssConstant
.
ENDPOINT
,
OssConstant
.
ACCESSKEYID
,
OssConstant
.
ACCESSKEYSECRET
);
.
build
(
OssConstant
.
ENDPOINT
,
OssConstant
.
ACCESSKEYID
,
OssConstant
.
ACCESSKEYSECRET
);
List
list
=
new
LinkedList
();
List
list
=
new
LinkedList
();
if
(
uploadFile
!=
null
&&
uploadFile
.
length
>
0
)
{
if
(
uploadFile
!=
null
&&
uploadFile
.
length
>
0
)
{
System
.
out
.
println
(
"osses文件数量"
+
uploadFile
.
length
);
System
.
out
.
println
(
"osses文件数量"
+
uploadFile
.
length
);
for
(
int
i
=
0
;
i
<
uploadFile
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
uploadFile
.
length
;
i
++)
{
MultipartFile
file
=
uploadFile
[
i
];
MultipartFile
file
=
uploadFile
[
i
];
InputStream
inputStream
=
null
;
InputStream
inputStream
=
null
;
try
{
try
{
inputStream
=
file
.
getInputStream
();
inputStream
=
file
.
getInputStream
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
return
ResultBody
.
error
(
e
.
getMessage
());
return
ResultBody
.
error
(
e
.
getMessage
());
}
}
try
(
final
BufferedInputStream
bis
=
new
BufferedInputStream
(
inputStream
))
{
try
(
final
BufferedInputStream
bis
=
new
BufferedInputStream
(
inputStream
))
{
// 校验
// 校验
int
typeNum
=
FileLoadUtil
.
checkFileType
(
FileLoadUtil
.
getType
(
bis
));
int
typeNum
=
FileLoadUtil
.
checkFileType
(
FileLoadUtil
.
getType
(
bis
));
if
(
typeNum
!=
1
)
{
if
(
typeNum
!=
1
)
{
return
ResultBody
.
error
(
ResultEnum
.
UPLOAD_IMG_ERROR
);
return
ResultBody
.
error
(
ResultEnum
.
UPLOAD_IMG_ERROR
);
}
}
String
oldName
=
file
.
getOriginalFilename
();
String
oldName
=
file
.
getOriginalFilename
();
String
newName
=
String
newName
=
"file/"
"file/"
+
UUID
.
randomUUID
().
toString
()
+
UUID
.
randomUUID
().
toString
()
+
oldName
.
substring
(
oldName
.
lastIndexOf
(
"."
),
oldName
.
length
());
+
oldName
.
substring
(
oldName
.
lastIndexOf
(
"."
),
oldName
.
length
());
ossClient
.
putObject
(
OssConstant
.
BUCKET
,
newName
,
bis
);
ossClient
.
putObject
(
OssConstant
.
BUCKET
,
newName
,
bis
);
System
.
out
.
println
(
"图片名称:"
+
newName
);
System
.
out
.
println
(
"图片名称:"
+
newName
);
list
.
add
(
"https://"
+
OssConstant
.
BUCKET
+
'.'
+
OssConstant
.
ENDPOINT
+
"/"
+
newName
);
list
.
add
(
"https://"
+
OssConstant
.
BUCKET
+
'.'
+
OssConstant
.
ENDPOINT
+
"/"
+
newName
);
}
}
}
}
ossClient
.
shutdown
();
// 关流
}
return
ResultBody
.
success
(
list
);
}
}
ossClient
.
shutdown
();
// 关流
return
ResultBody
.
success
(
list
);
}
@ApiOperation
(
value
=
"V1.0.1-上传一张图片文件到阿里云oss "
)
@ApiOperation
(
value
=
"V1.0.1-上传一张图片文件到阿里云oss "
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
@ApiImplicitParam
(
paramType
=
"header"
,
paramType
=
"header"
,
name
=
"mmc-identity"
,
name
=
"mmc-identity"
,
dataTypeClass
=
java
.
lang
.
String
.
class
,
dataTypeClass
=
java
.
lang
.
String
.
class
,
dataType
=
"String"
,
dataType
=
"String"
,
required
=
false
,
required
=
false
,
value
=
"token"
),
value
=
"token"
),
@ApiImplicitParam
(
@ApiImplicitParam
(
name
=
"uploadFile"
,
name
=
"uploadFile"
,
dataType
=
"MultipartFile"
,
dataType
=
"MultipartFile"
,
dataTypeClass
=
org
.
springframework
.
web
.
multipart
.
MultipartFile
.
class
,
dataTypeClass
=
org
.
springframework
.
web
.
multipart
.
MultipartFile
.
class
,
required
=
true
,
required
=
true
,
value
=
"文件"
),
value
=
"文件"
),
})
})
@PostMapping
(
"/singleImgOss"
)
@PostMapping
(
"/singleImgOss"
)
public
ResultBody
singleImgOss
(
public
ResultBody
singleImgOss
(
@RequestParam
(
"uploadFile"
)
MultipartFile
uploadFile
,
HttpServletRequest
request
)
@RequestParam
(
"uploadFile"
)
MultipartFile
uploadFile
,
HttpServletRequest
request
)
throws
IOException
{
throws
IOException
{
OSS
ossClient
=
OSS
ossClient
=
new
OSSClientBuilder
()
new
OSSClientBuilder
()
.
build
(
OssConstant
.
ENDPOINT
,
OssConstant
.
ACCESSKEYID
,
OssConstant
.
ACCESSKEYSECRET
);
.
build
(
OssConstant
.
ENDPOINT
,
OssConstant
.
ACCESSKEYID
,
OssConstant
.
ACCESSKEYSECRET
);
List
list
=
new
LinkedList
();
List
list
=
new
LinkedList
();
if
(
uploadFile
!=
null
)
{
if
(
uploadFile
!=
null
)
{
if
(
uploadFile
.
getSize
()
/
1024
>
3096
)
{
if
(
uploadFile
.
getSize
()
/
1024
>
3096
)
{
return
ResultBody
.
error
(
"请上传小于3M的图片"
);
return
ResultBody
.
error
(
"请上传小于3M的图片"
);
}
}
InputStream
inputStream
=
null
;
InputStream
inputStream
=
null
;
try
{
try
{
inputStream
=
uploadFile
.
getInputStream
();
inputStream
=
uploadFile
.
getInputStream
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
return
ResultBody
.
error
(
e
.
getMessage
());
return
ResultBody
.
error
(
e
.
getMessage
());
}
}
try
(
final
BufferedInputStream
bis
=
new
BufferedInputStream
(
inputStream
))
{
try
(
final
BufferedInputStream
bis
=
new
BufferedInputStream
(
inputStream
))
{
// 校验
// 校验
int
typeNum
=
FileLoadUtil
.
checkFileType
(
FileLoadUtil
.
getType
(
bis
));
int
typeNum
=
FileLoadUtil
.
checkFileType
(
FileLoadUtil
.
getType
(
bis
));
if
(
typeNum
!=
1
)
{
if
(
typeNum
!=
1
)
{
return
ResultBody
.
error
(
ResultEnum
.
UPLOAD_IMG_ERROR
);
return
ResultBody
.
error
(
ResultEnum
.
UPLOAD_IMG_ERROR
);
}
String
oldName
=
uploadFile
.
getOriginalFilename
();
String
newName
=
"file/"
+
UUID
.
randomUUID
().
toString
()
+
oldName
.
substring
(
oldName
.
lastIndexOf
(
"."
),
oldName
.
length
());
ossClient
.
putObject
(
OssConstant
.
BUCKET
,
newName
,
bis
);
System
.
out
.
println
(
"图片名称:"
+
newName
);
list
.
add
(
"https://"
+
OssConstant
.
BUCKET
+
'.'
+
OssConstant
.
ENDPOINT
+
"/"
+
newName
);
}
}
}
ossClient
.
shutdown
();
// 关流
String
oldName
=
uploadFile
.
getOriginalFilename
();
return
ResultBody
.
success
(
list
);
String
newName
=
"file/"
+
UUID
.
randomUUID
().
toString
()
+
oldName
.
substring
(
oldName
.
lastIndexOf
(
"."
),
oldName
.
length
());
ossClient
.
putObject
(
OssConstant
.
BUCKET
,
newName
,
bis
);
System
.
out
.
println
(
"图片名称:"
+
newName
);
list
.
add
(
"https://"
+
OssConstant
.
BUCKET
+
'.'
+
OssConstant
.
ENDPOINT
+
"/"
+
newName
);
}
}
}
ossClient
.
shutdown
();
// 关流
return
ResultBody
.
success
(
list
);
}
@ApiOperation
(
value
=
"V1.0.1-上传一张图片文件到阿里云oss "
)
@ApiOperation
(
value
=
"V1.0.1-上传一张图片文件到阿里云oss "
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
@ApiImplicitParam
(
paramType
=
"header"
,
paramType
=
"header"
,
name
=
"mmc-identity"
,
name
=
"mmc-identity"
,
dataTypeClass
=
java
.
lang
.
String
.
class
,
dataTypeClass
=
java
.
lang
.
String
.
class
,
dataType
=
"String"
,
dataType
=
"String"
,
required
=
false
,
required
=
false
,
value
=
"token"
),
value
=
"token"
),
@ApiImplicitParam
(
@ApiImplicitParam
(
name
=
"uploadFile"
,
name
=
"uploadFile"
,
dataType
=
"MultipartFile"
,
dataType
=
"MultipartFile"
,
dataTypeClass
=
org
.
springframework
.
web
.
multipart
.
MultipartFile
.
class
,
dataTypeClass
=
org
.
springframework
.
web
.
multipart
.
MultipartFile
.
class
,
required
=
true
,
required
=
true
,
value
=
"图片/返回图片名称及图片大小"
),
value
=
"图片/返回图片名称及图片大小"
),
})
})
@PostMapping
(
"/imgOsses"
)
@PostMapping
(
"/imgOsses"
)
public
ResultBody
imgOsses
(
public
ResultBody
imgOsses
(
@RequestParam
(
"uploadFile"
)
MultipartFile
[]
uploadFile
,
HttpServletRequest
request
)
@RequestParam
(
"uploadFile"
)
MultipartFile
[]
uploadFile
,
HttpServletRequest
request
)
throws
IOException
{
throws
IOException
{
OSS
ossClient
=
OSS
ossClient
=
new
OSSClientBuilder
()
new
OSSClientBuilder
()
.
build
(
OssConstant
.
ENDPOINT
,
OssConstant
.
ACCESSKEYID
,
OssConstant
.
ACCESSKEYSECRET
);
.
build
(
OssConstant
.
ENDPOINT
,
OssConstant
.
ACCESSKEYID
,
OssConstant
.
ACCESSKEYSECRET
);
Map
map
=
new
HashMap
();
Map
map
=
new
HashMap
();
if
(
uploadFile
!=
null
&&
uploadFile
.
length
>
0
)
{
if
(
uploadFile
!=
null
&&
uploadFile
.
length
>
0
)
{
System
.
out
.
println
(
"osses文件数量"
+
uploadFile
.
length
);
System
.
out
.
println
(
"osses文件数量"
+
uploadFile
.
length
);
for
(
int
i
=
0
;
i
<
uploadFile
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
uploadFile
.
length
;
i
++)
{
MultipartFile
file
=
uploadFile
[
i
];
MultipartFile
file
=
uploadFile
[
i
];
InputStream
inputStream
=
null
;
InputStream
inputStream
=
null
;
try
{
try
{
inputStream
=
file
.
getInputStream
();
inputStream
=
file
.
getInputStream
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
return
ResultBody
.
error
(
e
.
getMessage
());
return
ResultBody
.
error
(
e
.
getMessage
());
}
}
try
(
final
BufferedInputStream
bis
=
new
BufferedInputStream
(
inputStream
))
{
try
(
final
BufferedInputStream
bis
=
new
BufferedInputStream
(
inputStream
))
{
// 校验
// 校验
int
typeNum
=
FileLoadUtil
.
checkFileType
(
FileLoadUtil
.
getType
(
bis
));
int
typeNum
=
FileLoadUtil
.
checkFileType
(
FileLoadUtil
.
getType
(
bis
));
if
(
typeNum
!=
1
)
{
if
(
typeNum
!=
1
)
{
return
ResultBody
.
error
(
ResultEnum
.
UPLOAD_IMG_ERROR
);
return
ResultBody
.
error
(
ResultEnum
.
UPLOAD_IMG_ERROR
);
}
}
String
oldName
=
file
.
getOriginalFilename
();
String
oldName
=
file
.
getOriginalFilename
();
String
newName
=
String
newName
=
"file/"
"file/"
+
UUID
.
randomUUID
().
toString
()
+
UUID
.
randomUUID
().
toString
()
+
oldName
.
substring
(
oldName
.
lastIndexOf
(
"."
),
oldName
.
length
());
+
oldName
.
substring
(
oldName
.
lastIndexOf
(
"."
),
oldName
.
length
());
ossClient
.
putObject
(
OssConstant
.
BUCKET
,
newName
,
bis
);
ossClient
.
putObject
(
OssConstant
.
BUCKET
,
newName
,
bis
);
System
.
out
.
println
(
"图片名称:"
+
newName
);
System
.
out
.
println
(
"图片名称:"
+
newName
);
map
.
put
(
map
.
put
(
"filePath"
,
"filePath"
,
"https://"
+
OssConstant
.
BUCKET
+
'.'
+
OssConstant
.
ENDPOINT
+
"/"
+
newName
);
"https://"
+
OssConstant
.
BUCKET
+
'.'
+
OssConstant
.
ENDPOINT
+
"/"
+
newName
);
map
.
put
(
"fileName"
,
oldName
);
map
.
put
(
"fileName"
,
oldName
);
map
.
put
(
"fileSize"
,
file
.
getSize
());
map
.
put
(
"fileSize"
,
file
.
getSize
());
map
.
put
(
"fileType"
,
oldName
.
substring
(
oldName
.
lastIndexOf
(
"."
)).
replace
(
"."
,
""
));
map
.
put
(
"fileType"
,
oldName
.
substring
(
oldName
.
lastIndexOf
(
"."
)).
replace
(
"."
,
""
));
}
}
}
}
ossClient
.
shutdown
();
// 关流
}
return
ResultBody
.
success
(
map
);
}
}
ossClient
.
shutdown
();
// 关流
return
ResultBody
.
success
(
map
);
}
private
byte
[]
readByte
(
final
InputStream
is
)
throws
IOException
{
private
byte
[]
readByte
(
final
InputStream
is
)
throws
IOException
{
try
(
BufferedInputStream
bis
=
new
BufferedInputStream
(
is
);
try
(
BufferedInputStream
bis
=
new
BufferedInputStream
(
is
);
ByteArrayOutputStream
bas
=
new
ByteArrayOutputStream
(
4096
);
ByteArrayOutputStream
bas
=
new
ByteArrayOutputStream
(
4096
);
BufferedOutputStream
bos
=
new
BufferedOutputStream
(
bas
))
{
BufferedOutputStream
bos
=
new
BufferedOutputStream
(
bas
))
{
byte
[]
bytes
=
new
byte
[
4096
];
byte
[]
bytes
=
new
byte
[
4096
];
int
size
;
int
size
;
while
((
size
=
bis
.
read
(
bytes
))
!=
-
1
)
{
while
((
size
=
bis
.
read
(
bytes
))
!=
-
1
)
{
bos
.
write
(
bytes
,
0
,
size
);
bos
.
write
(
bytes
,
0
,
size
);
}
}
return
bas
.
toByteArray
();
return
bas
.
toByteArray
();
}
}
}
}
@ApiOperation
(
value
=
"V1.0.1-上传文档文件到阿里云oss"
)
@ApiOperation
(
value
=
"V1.0.1-上传文档文件到阿里云oss"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
@ApiImplicitParam
(
paramType
=
"header"
,
paramType
=
"header"
,
name
=
"mmc-identity"
,
name
=
"mmc-identity"
,
dataTypeClass
=
java
.
lang
.
String
.
class
,
dataTypeClass
=
java
.
lang
.
String
.
class
,
dataType
=
"String"
,
dataType
=
"String"
,
required
=
true
,
required
=
true
,
value
=
"token"
),
value
=
"token"
),
@ApiImplicitParam
(
@ApiImplicitParam
(
name
=
"uploadFile"
,
name
=
"uploadFile"
,
dataType
=
"MultipartFile"
,
dataType
=
"MultipartFile"
,
dataTypeClass
=
org
.
springframework
.
web
.
multipart
.
MultipartFile
.
class
,
dataTypeClass
=
org
.
springframework
.
web
.
multipart
.
MultipartFile
.
class
,
required
=
true
,
required
=
true
,
value
=
"文件 doc,ppt,pdf,xls结尾"
),
value
=
"文件 doc,ppt,pdf,xls结尾"
),
})
})
@PostMapping
(
"/docOss"
)
@PostMapping
(
"/docOss"
)
public
ResultBody
docOss
(
public
ResultBody
docOss
(
@RequestParam
(
"uploadFile"
)
MultipartFile
[]
uploadFile
,
HttpServletRequest
request
)
@RequestParam
(
"uploadFile"
)
MultipartFile
[]
uploadFile
,
HttpServletRequest
request
)
throws
IOException
{
throws
IOException
{
OSS
ossClient
=
OSS
ossClient
=
new
OSSClientBuilder
()
new
OSSClientBuilder
()
.
build
(
OssConstant
.
ENDPOINT
,
OssConstant
.
ACCESSKEYID
,
OssConstant
.
ACCESSKEYSECRET
);
.
build
(
OssConstant
.
ENDPOINT
,
OssConstant
.
ACCESSKEYID
,
OssConstant
.
ACCESSKEYSECRET
);
Map
map
=
new
HashMap
();
Map
map
=
new
HashMap
();
if
(
uploadFile
!=
null
&&
uploadFile
.
length
>
0
)
{
if
(
uploadFile
!=
null
&&
uploadFile
.
length
>
0
)
{
System
.
out
.
println
(
"osses文件数量"
+
uploadFile
.
length
);
System
.
out
.
println
(
"osses文件数量"
+
uploadFile
.
length
);
for
(
int
i
=
0
;
i
<
uploadFile
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
uploadFile
.
length
;
i
++)
{
MultipartFile
file
=
uploadFile
[
i
];
MultipartFile
file
=
uploadFile
[
i
];
InputStream
inputStream
=
null
;
InputStream
inputStream
=
null
;
try
{
try
{
inputStream
=
file
.
getInputStream
();
inputStream
=
file
.
getInputStream
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
return
ResultBody
.
error
(
e
.
getMessage
());
return
ResultBody
.
error
(
e
.
getMessage
());
}
}
try
(
final
BufferedInputStream
bis
=
new
BufferedInputStream
(
inputStream
))
{
try
(
final
BufferedInputStream
bis
=
new
BufferedInputStream
(
inputStream
))
{
// 校验
// 校验
int
typeNum
=
FileLoadUtil
.
checkFileType
(
FileLoadUtil
.
getType
(
bis
));
int
typeNum
=
FileLoadUtil
.
checkFileType
(
FileLoadUtil
.
getType
(
bis
));
if
(
typeNum
!=
2
)
{
if
(
typeNum
!=
2
)
{
return
ResultBody
.
error
(
ResultEnum
.
UPLOAD_DOC_ERROR
);
return
ResultBody
.
error
(
ResultEnum
.
UPLOAD_DOC_ERROR
);
}
}
String
oldName
=
file
.
getOriginalFilename
();
String
oldName
=
file
.
getOriginalFilename
();
String
newName
=
String
newName
=
"file/"
"file/"
+
UUID
.
randomUUID
().
toString
()
+
UUID
.
randomUUID
().
toString
()
+
oldName
.
substring
(
oldName
.
lastIndexOf
(
"."
),
oldName
.
length
());
+
oldName
.
substring
(
oldName
.
lastIndexOf
(
"."
),
oldName
.
length
());
ossClient
.
putObject
(
OssConstant
.
BUCKET
,
newName
,
bis
);
ossClient
.
putObject
(
OssConstant
.
BUCKET
,
newName
,
bis
);
System
.
out
.
println
(
"文档名称:"
+
newName
);
System
.
out
.
println
(
"文档名称:"
+
newName
);
map
.
put
(
map
.
put
(
"filePath"
,
"filePath"
,
"https://"
+
OssConstant
.
BUCKET
+
'.'
+
OssConstant
.
ENDPOINT
+
"/"
+
newName
);
"https://"
+
OssConstant
.
BUCKET
+
'.'
+
OssConstant
.
ENDPOINT
+
"/"
+
newName
);
map
.
put
(
"fileName"
,
oldName
);
map
.
put
(
"fileName"
,
oldName
);
map
.
put
(
"fileSize"
,
file
.
getSize
());
map
.
put
(
"fileSize"
,
file
.
getSize
());
map
.
put
(
"fileType"
,
oldName
.
substring
(
oldName
.
lastIndexOf
(
"."
)).
replace
(
"."
,
""
));
map
.
put
(
"fileType"
,
oldName
.
substring
(
oldName
.
lastIndexOf
(
"."
)).
replace
(
"."
,
""
));
}
}
}
}
ossClient
.
shutdown
();
// 关流
}
return
ResultBody
.
success
(
map
);
}
}
ossClient
.
shutdown
();
// 关流
return
ResultBody
.
success
(
map
);
}
/**
/**
* 上传文件
* 上传文件
*
*
* @param uploadFile
* @param uploadFile
* @return
* @return
*/
*/
@ApiIgnore
@ApiIgnore
@RequestMapping
(
value
=
"/local"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/local"
,
method
=
RequestMethod
.
POST
)
public
ResultBody
local
(
public
ResultBody
local
(
@RequestParam
(
value
=
"uploadFile"
,
required
=
false
)
MultipartFile
[]
uploadFile
,
@RequestParam
(
value
=
"uploadFile"
,
required
=
false
)
MultipartFile
[]
uploadFile
,
@RequestParam
(
value
=
"directory"
,
required
=
false
,
defaultValue
=
"upload"
)
@RequestParam
(
value
=
"directory"
,
required
=
false
,
defaultValue
=
"upload"
)
String
directory
,
String
directory
,
HttpServletRequest
request
)
HttpServletRequest
request
)
throws
IOException
{
throws
IOException
{
return
FileLoadUtil
.
bathCreateFile
(
directory
,
uploadFile
);
return
FileLoadUtil
.
bathCreateFile
(
directory
,
uploadFile
);
}
}
/**
/**
* 下载文件
* 下载文件
*
*
* @param path
* @param path
* @param response
* @param response
* @throws IOException
* @throws IOException
*/
*/
@ApiIgnore
@ApiIgnore
@RequestMapping
(
value
=
"/download/{path}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/download/{path}"
,
method
=
RequestMethod
.
GET
)
public
void
getDownloadFile
(
@PathVariable
(
"path"
)
String
path
,
HttpServletResponse
response
)
public
void
getDownloadFile
(
@PathVariable
(
"path"
)
String
path
,
HttpServletResponse
response
)
throws
IOException
{
throws
IOException
{
response
.
setContentType
(
"application/x-001"
);
response
.
setContentType
(
"application/x-001"
);
path
=
FileLoadUtil
.
explainLoadPath
(
path
);
path
=
FileLoadUtil
.
explainLoadPath
(
path
);
ServletOutputStream
out
=
response
.
getOutputStream
();
ServletOutputStream
out
=
response
.
getOutputStream
();
FileInputStream
in
=
new
FileInputStream
(
new
File
(
path
));
FileInputStream
in
=
new
FileInputStream
(
new
File
(
path
));
byte
buffer
[]
=
new
byte
[
1024
];
byte
buffer
[]
=
new
byte
[
1024
];
int
length
=
0
;
int
length
=
0
;
while
((
length
=
in
.
read
(
buffer
))
!=
-
1
)
{
while
((
length
=
in
.
read
(
buffer
))
!=
-
1
)
{
out
.
write
(
buffer
,
0
,
length
);
out
.
write
(
buffer
,
0
,
length
);
}
in
.
close
();
out
.
close
();
}
}
in
.
close
();
out
.
close
();
}
@ApiIgnore
@ApiIgnore
@RequestMapping
(
value
=
"/heart"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/heart"
,
method
=
RequestMethod
.
GET
)
public
ResultBody
heart
()
{
public
ResultBody
heart
()
{
return
ResultBody
.
success
(
"heart"
);
return
ResultBody
.
success
(
"heart"
);
}
}
}
}
src/main/java/com/mmc/pms/controller/WebAndMiniProgramCategoryController.java
deleted
100644 → 0
浏览文件 @
ea4eb88b
package
com
.
mmc
.
pms
.
controller
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @Author LW
* @date 2023/6/7 13:33
* 概要:
*/
@Api
(
tags
=
{
"分类信息"
})
@RestController
@RequestMapping
(
"/category"
)
public
class
WebAndMiniProgramCategoryController
{
// @ApiOperation(value = "web-分类信息")
// @PostMapping("queryCategoryByType")
// @ApiResponses({@ApiResponse(code = 200, message = "OK", response = GoodsInfoListDTO.class)})
// public ResultBody<GoodsInfoListDTO> listPageGoodsInfo(
// @ApiParam("商品查询条件QO") @RequestBody GoodsInfoQO param) {
// return ResultBody.success(webProductMallService.listPageGoodsInfo(param));
// }
}
src/main/java/com/mmc/pms/controller/WebDeviceController.java
浏览文件 @
a3df433c
...
@@ -5,20 +5,16 @@ import com.mmc.pms.common.ResultEnum;
...
@@ -5,20 +5,16 @@ import com.mmc.pms.common.ResultEnum;
import
com.mmc.pms.model.lease.dto.BrandDTO
;
import
com.mmc.pms.model.lease.dto.BrandDTO
;
import
com.mmc.pms.model.lease.dto.DeviceCategoryDTO
;
import
com.mmc.pms.model.lease.dto.DeviceCategoryDTO
;
import
com.mmc.pms.model.lease.dto.WareInfoDTO
;
import
com.mmc.pms.model.lease.dto.WareInfoDTO
;
import
com.mmc.pms.model.lease.dto.WareInfoItemDTO
;
import
com.mmc.pms.model.lease.vo.LeaseVo
;
import
com.mmc.pms.model.lease.vo.LeaseVo
;
import
com.mmc.pms.model.other.dto.AdDTO
;
import
com.mmc.pms.model.other.dto.AdDTO
;
import
com.mmc.pms.model.other.dto.DistrictInfoDTO
;
import
com.mmc.pms.model.other.dto.DistrictInfoDTO
;
import
com.mmc.pms.model.other.dto.ModelDTO
;
import
com.mmc.pms.model.other.dto.ModelDTO
;
import
com.mmc.pms.model.qo.WareInfoQO
;
import
com.mmc.pms.page.Page
;
import
com.mmc.pms.service.WebDeviceService
;
import
com.mmc.pms.service.WebDeviceService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiResponse
;
import
io.swagger.annotations.ApiResponse
;
import
io.swagger.annotations.ApiResponses
;
import
io.swagger.annotations.ApiResponses
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
/**
/**
...
@@ -91,13 +87,13 @@ public class WebDeviceController {
...
@@ -91,13 +87,13 @@ public class WebDeviceController {
public
ResultBody
<
AdDTO
>
ad
()
{
public
ResultBody
<
AdDTO
>
ad
()
{
return
webDeviceService
.
ad
();
return
webDeviceService
.
ad
();
}
}
//
@ApiOperation
(
value
=
"设备列表筛选"
)
//
@ApiOperation(value = "设备列表筛选")
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
WareInfoItemDTO
.
class
)})
//
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = WareInfoItemDTO.class)})
@PostMapping
(
"/deviceList"
)
//
@PostMapping("/deviceList")
public
ResultBody
<
WareInfoItemDTO
>
listWareInfoPage
(
//
public ResultBody<WareInfoItemDTO> listWareInfoPage(
@RequestBody
@Validated
(
Page
.
class
)
WareInfoQO
param
)
{
//
@RequestBody @Validated(Page.class) WareInfoQO param) {
return
webDeviceService
.
listWareInfoPage
(
param
);
// return webDeviceService.listWareInfoPage(param, request
);
}
//
}
}
}
src/main/java/com/mmc/pms/controller/mini/MiniLeaseGoodsController.java
0 → 100644
浏览文件 @
a3df433c
package
com
.
mmc
.
pms
.
controller
.
mini
;
import
com.mmc.pms.common.Page
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.controller.BaseController
;
import
com.mmc.pms.model.lease.dto.LeaseGoodsInfoDTO
;
import
com.mmc.pms.model.qo.WareInfoQO
;
import
com.mmc.pms.service.WebDeviceService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiResponse
;
import
io.swagger.annotations.ApiResponses
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletRequest
;
/**
* @Author LW
* @date 2023/6/8 17:16
* 概要:
*/
@Api
(
tags
=
{
"v1.0.1-设备租赁-相关接口"
})
@RestController
@RequestMapping
(
"/lease/goods"
)
public
class
MiniLeaseGoodsController
extends
BaseController
{
@Autowired
private
WebDeviceService
webDeviceService
;
@ApiOperation
(
value
=
"设备列表筛选"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
LeaseGoodsInfoDTO
.
class
)})
@PostMapping
(
"/deviceList"
)
public
ResultBody
listWareInfoPage
(
@RequestBody
@Validated
(
Page
.
class
)
WareInfoQO
param
,
HttpServletRequest
request
)
{
return
webDeviceService
.
listWareInfoPage
(
param
,
request
,
this
.
getUserLoginInfoFromRedis
(
request
).
getUserAccountId
());
}
}
src/main/java/com/mmc/pms/controller/web/WebLeaseGoodsController.java
0 → 100644
浏览文件 @
a3df433c
package
com
.
mmc
.
pms
.
controller
.
web
;
import
com.mmc.pms.service.WebDeviceService
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
/**
* @Author LW
* @date 2023/6/8 15:19
* 概要:
*/
@RestController
@RequestMapping
(
"/lease/goods"
)
@Api
(
tags
=
{
"web端-设备租赁-相关接口"
})
public
class
WebLeaseGoodsController
{
@Resource
WebDeviceService
webDeviceService
;
}
src/main/java/com/mmc/pms/dao/BackstageTaskServiceDao.java
浏览文件 @
a3df433c
...
@@ -8,18 +8,20 @@ import java.util.List;
...
@@ -8,18 +8,20 @@ import java.util.List;
/**
/**
* @Author LW
* @Author LW
*
@date 2023/6/6 10:48
*
* 概要:
*
@date 2023/6/6 10:48
概要:
*/
*/
@Mapper
@Mapper
public
interface
BackstageTaskServiceDao
{
public
interface
BackstageTaskServiceDao
{
int
insert
(
ServiceDO
serviceDO
);
Integer
insert
(
ServiceDO
serviceDO
);
int
update
(
ServiceDO
serviceDO
);
Integer
update
(
ServiceDO
serviceDO
);
int
deleteById
(
Integer
id
);
Integer
deleteById
(
Integer
id
);
ServiceDO
queryById
(
Integer
id
);
ServiceDO
queryById
(
Integer
id
);
List
<
ServiceDO
>
queryAllByLimit
(
ServiceQO
param
);
List
<
ServiceDO
>
queryAllByLimit
(
ServiceQO
param
);
Integer
count
(
ServiceQO
param
);
}
}
src/main/java/com/mmc/pms/dao/CategoriesDao.java
浏览文件 @
a3df433c
package
com
.
mmc
.
pms
.
dao
;
package
com
.
mmc
.
pms
.
dao
;
import
com.mmc.pms.entity.Categories
;
import
com.mmc.pms.entity.Categories
;
import
com.mmc.pms.entity.Directory
;
import
com.mmc.pms.entity.Directory
DO
;
import
com.mmc.pms.model.categories.vo.ClassifyInfoVO
;
import
com.mmc.pms.model.categories.vo.ClassifyInfoVO
;
import
com.mmc.pms.model.categories.vo.DirectoryInfoVO
;
import
com.mmc.pms.model.categories.vo.DirectoryInfoVO
;
import
com.mmc.pms.model.sale.vo.QueryClassifyVO
;
import
com.mmc.pms.model.sale.vo.QueryClassifyVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Set
;
/**
/**
* @author 23214
* @author 23214
...
@@ -20,13 +22,13 @@ public interface CategoriesDao {
...
@@ -20,13 +22,13 @@ public interface CategoriesDao {
int
countUpdateDirectoryName
(
DirectoryInfoVO
param
);
int
countUpdateDirectoryName
(
DirectoryInfoVO
param
);
void
insertDirectory
(
Directory
directory
);
void
insertDirectory
(
Directory
DO
directory
);
void
updateDirectory
(
Directory
directory
);
void
updateDirectory
(
Directory
DO
directory
);
int
countDirectoryList
();
int
countDirectoryList
();
List
<
Directory
>
directoryList
(
int
pageNo
,
Integer
pageSize
,
Integer
type
);
List
<
Directory
DO
>
directoryList
(
int
pageNo
,
Integer
pageSize
,
Integer
type
);
int
countDirectory
(
Integer
id
);
int
countDirectory
(
Integer
id
);
...
@@ -52,7 +54,14 @@ public interface CategoriesDao {
...
@@ -52,7 +54,14 @@ public interface CategoriesDao {
int
deleteById
(
Integer
id
);
int
deleteById
(
Integer
id
);
List
<
Directory
>
getDirectoryList
(
Integer
type
);
List
<
DirectoryDO
>
getDirectoryList
(
Integer
type
);
List
<
Categories
>
getCategoriesByDirectoryId
(
Integer
directoryId
);
List
<
Categories
>
getCategoriesListByIds
(
@Param
(
"ids"
)
Set
<
Integer
>
ids
);
List
<
Categories
>
selectCategoryByDirectoryId
(
List
<
Integer
>
directoryIds
);
}
}
...
...
src/main/java/com/mmc/pms/dao/DirectoryDao.java
0 → 100644
浏览文件 @
a3df433c
package
com
.
mmc
.
pms
.
dao
;
import
com.mmc.pms.entity.DirectoryDO
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* <p>
* Mapper 接口
* </p>
*
* @author Pika
* @since 2023-06-08
*/
@Mapper
public
interface
DirectoryDao
{
DirectoryDO
getDirectoryByName
(
String
directoryName
);
}
src/main/java/com/mmc/pms/dao/GoodsInfoDao.java
浏览文件 @
a3df433c
...
@@ -90,6 +90,10 @@ public interface GoodsInfoDao {
...
@@ -90,6 +90,10 @@ public interface GoodsInfoDao {
List
<
MallGoodsProductDO
>
listIndustryProductList
(
List
<
Integer
>
industrySpecIds
);
List
<
MallGoodsProductDO
>
listIndustryProductList
(
List
<
Integer
>
industrySpecIds
);
List
<
GoodsInfo
>
ListGoodsInfoByCategoryId
(
Integer
id
);
List
<
GoodsInfo
>
ListGoodsInfoByCategoryId
(
Integer
id
);
List
<
MallProdSkuInfoSpecDO
>
getMallProSkuInfoSpec
(
Integer
goodsInfoId
);
List
<
MallProdSkuInfoSpecDO
>
listMallprodSpecById
(
List
<
Integer
>
goodsIds
);
}
}
...
...
src/main/java/com/mmc/pms/dao/ProductDao.java
浏览文件 @
a3df433c
...
@@ -112,6 +112,7 @@ public interface ProductDao {
...
@@ -112,6 +112,7 @@ public interface ProductDao {
List
<
OrderGoodsProdDTO
>
listProdGoodsSkuInfo
(
MallOrderGoodsInfoQO
mallOrderGoodsInfoQO
);
List
<
OrderGoodsProdDTO
>
listProdGoodsSkuInfo
(
MallOrderGoodsInfoQO
mallOrderGoodsInfoQO
);
List
<
MallProdSkuInfoSpecDO
>
listMallProductSpec
(
Integer
id
);
List
<
MallProdSkuInfoSpecDO
>
listMallProductSpec
(
Integer
id
);
}
}
...
...
src/main/java/com/mmc/pms/dao/WebDeviceDao.java
浏览文件 @
a3df433c
...
@@ -2,8 +2,8 @@ package com.mmc.pms.dao;
...
@@ -2,8 +2,8 @@ package com.mmc.pms.dao;
import
com.mmc.pms.entity.*
;
import
com.mmc.pms.entity.*
;
import
com.mmc.pms.model.lease.vo.LeaseVo
;
import
com.mmc.pms.model.lease.vo.LeaseVo
;
import
com.mmc.pms.model.qo.WareInfoQO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.List
;
...
@@ -33,9 +33,10 @@ public interface WebDeviceDao {
...
@@ -33,9 +33,10 @@ public interface WebDeviceDao {
List
<
WareInfoDO
>
detail
(
Integer
id
);
List
<
WareInfoDO
>
detail
(
Integer
id
);
int
countListWareInfoPage
(
WareInfoQO
param
);
int
countListWareInfoPage
(
@Param
(
"categoryIds"
)
List
<
Integer
>
categoryIds
,
@Param
(
"userIds"
)
List
<
Integer
>
userIds
);
List
<
WareInfoDO
>
listWareInfoPage
(
WareInfoQO
param
);
List
<
GoodsInfo
>
listWareInfoPage
(
@Param
(
"categoryIds"
)
List
<
Integer
>
categoryIds
,
@Param
(
"userIds"
)
List
<
Integer
>
userId
,
@Param
(
"pageNo"
)
Integer
pageNo
,
@Param
(
"pageSize"
)
Integer
pageSize
);
WareInfoDO
getWareInfoById
(
Integer
id
);
WareInfoDO
getWareInfoById
(
Integer
id
);
...
...
src/main/java/com/mmc/pms/entity/Categories.java
浏览文件 @
a3df433c
package
com
.
mmc
.
pms
.
entity
;
package
com
.
mmc
.
pms
.
entity
;
import
com.mmc.pms.model.categories.dto.CategoriesInfoListDTO
;
import
com.mmc.pms.model.categories.dto.ClassifyDetailsDTO
;
import
com.mmc.pms.model.categories.dto.ClassifyDetailsDTO
;
import
com.mmc.pms.model.categories.dto.ClassifyInfoDTO
;
import
com.mmc.pms.model.categories.dto.ClassifyInfoDTO
;
import
com.mmc.pms.model.categories.vo.ClassifyInfoVO
;
import
com.mmc.pms.model.categories.vo.ClassifyInfoVO
;
...
@@ -65,4 +66,8 @@ public class Categories implements Serializable {
...
@@ -65,4 +66,8 @@ public class Categories implements Serializable {
.
icon
(
icon
).
classifyName
(
name
)
.
icon
(
icon
).
classifyName
(
name
)
.
remark
(
remark
).
build
();
.
remark
(
remark
).
build
();
}
}
public
CategoriesInfoListDTO
buildCategoriesInfoListDTO
()
{
return
CategoriesInfoListDTO
.
builder
().
id
(
id
).
icon
(
icon
).
directoryId
(
directoryId
).
name
(
name
).
build
();
}
}
}
\ No newline at end of file
src/main/java/com/mmc/pms/entity/Directory.java
→
src/main/java/com/mmc/pms/entity/Directory
DO
.java
浏览文件 @
a3df433c
package
com
.
mmc
.
pms
.
entity
;
package
com
.
mmc
.
pms
.
entity
;
import
com.mmc.pms.model.categories.dto.AllCategoryDTO
;
import
com.mmc.pms.model.categories.vo.DirectoryInfoVO
;
import
com.mmc.pms.model.categories.vo.DirectoryInfoVO
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -17,7 +18,7 @@ import java.util.Date;
...
@@ -17,7 +18,7 @@ import java.util.Date;
@Data
@Data
@AllArgsConstructor
@AllArgsConstructor
@NoArgsConstructor
@NoArgsConstructor
public
class
Directory
implements
Serializable
{
public
class
Directory
DO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
713939370607409336L
;
private
static
final
long
serialVersionUID
=
713939370607409336L
;
/**
/**
* 主键id
* 主键id
...
@@ -50,7 +51,7 @@ public class Directory implements Serializable {
...
@@ -50,7 +51,7 @@ public class Directory implements Serializable {
private
String
relevanceName
;
private
String
relevanceName
;
public
Directory
(
DirectoryInfoVO
param
)
{
public
Directory
DO
(
DirectoryInfoVO
param
)
{
this
.
id
=
param
.
getId
();
this
.
id
=
param
.
getId
();
this
.
directoryName
=
param
.
getDirectoryName
();
this
.
directoryName
=
param
.
getDirectoryName
();
this
.
pid
=
param
.
getPid
();
this
.
pid
=
param
.
getPid
();
...
@@ -60,5 +61,10 @@ public class Directory implements Serializable {
...
@@ -60,5 +61,10 @@ public class Directory implements Serializable {
public
DirectoryInfoVO
buildDirectoryInfoVO
()
{
public
DirectoryInfoVO
buildDirectoryInfoVO
()
{
return
DirectoryInfoVO
.
builder
().
id
(
id
).
directoryName
(
directoryName
).
pid
(
pid
).
relevanceName
(
relevanceName
).
type
(
type
).
build
();
return
DirectoryInfoVO
.
builder
().
id
(
id
).
directoryName
(
directoryName
).
pid
(
pid
).
relevanceName
(
relevanceName
).
type
(
type
).
build
();
}
}
public
AllCategoryDTO
buildAllCategoryDTO
()
{
return
AllCategoryDTO
.
builder
().
directoryId
(
id
).
name
(
directoryName
).
build
();
}
}
}
src/main/java/com/mmc/pms/entity/GoodsInfo.java
浏览文件 @
a3df433c
package
com
.
mmc
.
pms
.
entity
;
package
com
.
mmc
.
pms
.
entity
;
import
com.mmc.pms.model.categories.vo.RelevanceGoodsInfoVO
;
import
com.mmc.pms.model.categories.vo.RelevanceGoodsInfoVO
;
import
com.mmc.pms.model.lease.dto.LeaseGoodsInfoDTO
;
import
com.mmc.pms.model.sale.vo.GoodsAddVO
;
import
com.mmc.pms.model.sale.vo.GoodsAddVO
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -75,4 +76,8 @@ public class GoodsInfo implements Serializable {
...
@@ -75,4 +76,8 @@ public class GoodsInfo implements Serializable {
public
RelevanceGoodsInfoVO
buildRelevanceGoodsInfoVO
()
{
public
RelevanceGoodsInfoVO
buildRelevanceGoodsInfoVO
()
{
return
RelevanceGoodsInfoVO
.
builder
().
id
(
id
).
goodsName
(
goodsName
).
shelf
(
shelfStatus
).
mainImage
(
mainImg
).
build
();
return
RelevanceGoodsInfoVO
.
builder
().
id
(
id
).
goodsName
(
goodsName
).
shelf
(
shelfStatus
).
mainImage
(
mainImg
).
build
();
}
}
public
LeaseGoodsInfoDTO
buildLeaseGoodsInfoDTO
()
{
return
LeaseGoodsInfoDTO
.
builder
().
id
(
id
).
goodsName
(
goodsName
).
images
(
mainImg
).
build
();
}
}
}
\ No newline at end of file
src/main/java/com/mmc/pms/entity/MallProdSkuInfoSpecDO.java
浏览文件 @
a3df433c
...
@@ -6,6 +6,7 @@ import lombok.NoArgsConstructor;
...
@@ -6,6 +6,7 @@ import lombok.NoArgsConstructor;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.Date
;
/**
/**
...
@@ -16,16 +17,17 @@ import java.util.Date;
...
@@ -16,16 +17,17 @@ import java.util.Date;
@AllArgsConstructor
@AllArgsConstructor
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
public
class
MallProdSkuInfoSpecDO
implements
Serializable
{
public
class
MallProdSkuInfoSpecDO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
8247363408322497387L
;
private
static
final
long
serialVersionUID
=
-
8247363408322497387L
;
private
Integer
id
;
private
Integer
id
;
private
Integer
mallProdSkuInfoId
;
private
Integer
mallProdSkuInfoId
;
private
Integer
goodsInfoId
;
private
Integer
goodsInfoId
;
private
Integer
productSpecId
;
private
Integer
productSpecId
;
private
Integer
deleted
;
private
Integer
deleted
;
private
Date
createTime
;
private
Date
createTime
;
private
Date
updateTime
;
private
Date
updateTime
;
private
String
goodsName
;
private
String
goodsName
;
private
BigDecimal
price
;
private
ProductSpecDO
productSpecDO
;
private
ProductSpecDO
productSpecDO
;
}
}
src/main/java/com/mmc/pms/entity/RepoCashDO.java
浏览文件 @
a3df433c
...
@@ -20,53 +20,53 @@ import java.util.Date;
...
@@ -20,53 +20,53 @@ import java.util.Date;
@AllArgsConstructor
@AllArgsConstructor
@NoArgsConstructor
@NoArgsConstructor
public
class
RepoCashDO
implements
Serializable
{
public
class
RepoCashDO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
7930603317037474755L
;
private
static
final
long
serialVersionUID
=
-
7930603317037474755L
;
private
Integer
id
;
private
Integer
id
;
private
Integer
repoAccountId
;
private
Integer
repoAccountId
;
private
String
uid
;
private
String
uid
;
private
String
accountName
;
private
String
accountName
;
private
Integer
orderInfoId
;
private
Integer
orderInfoId
;
private
String
orderNo
;
private
String
orderNo
;
private
Integer
skuInfoId
;
private
Integer
skuInfoId
;
private
String
skuTitle
;
private
String
skuTitle
;
private
Integer
wareInfoId
;
private
Integer
wareInfoId
;
private
String
wareNo
;
private
String
wareNo
;
private
String
wareTitle
;
private
String
wareTitle
;
private
String
payNo
;
private
String
payNo
;
private
Integer
payMethod
;
private
Integer
payMethod
;
private
BigDecimal
amtPaid
;
private
BigDecimal
amtPaid
;
private
BigDecimal
cashAmt
;
private
BigDecimal
cashAmt
;
private
Date
payTime
;
private
Date
payTime
;
private
String
refundNo
;
private
String
refundNo
;
private
String
voucher
;
private
String
voucher
;
private
String
remark
;
private
String
remark
;
private
Integer
createUser
;
private
Integer
createUser
;
private
Date
createTime
;
private
Date
createTime
;
private
Integer
updateUser
;
private
Integer
updateUser
;
private
Date
updateTime
;
private
Date
updateTime
;
public
RepoCashDTO
buildRepoCashDTO
()
{
public
RepoCashDTO
buildRepoCashDTO
()
{
return
RepoCashDTO
.
builder
()
return
RepoCashDTO
.
builder
()
.
id
(
this
.
id
)
.
id
(
this
.
id
)
.
repoAccountId
(
this
.
repoAccountId
)
.
repoAccountId
(
this
.
repoAccountId
)
.
uid
(
this
.
uid
)
.
uid
(
this
.
uid
)
.
accountName
(
this
.
accountName
)
.
accountName
(
this
.
accountName
)
.
orderInfoId
(
this
.
orderInfoId
)
.
orderInfoId
(
this
.
orderInfoId
)
.
orderNo
(
this
.
orderNo
)
.
orderNo
(
this
.
orderNo
)
.
skuInfoId
(
this
.
skuInfoId
)
.
skuInfoId
(
this
.
skuInfoId
)
.
skuTitle
(
this
.
skuTitle
)
.
skuTitle
(
this
.
skuTitle
)
.
wareInfoId
(
this
.
wareInfoId
)
.
wareInfoId
(
this
.
wareInfoId
)
.
wareNo
(
this
.
wareNo
)
.
wareNo
(
this
.
wareNo
)
.
wareTitle
(
this
.
wareTitle
)
.
wareTitle
(
this
.
wareTitle
)
.
payNo
(
this
.
payNo
)
.
payNo
(
this
.
payNo
)
.
payMethod
(
this
.
payMethod
)
.
payMethod
(
this
.
payMethod
)
.
amtPaid
(
this
.
amtPaid
)
.
amtPaid
(
this
.
amtPaid
)
.
refundNo
(
this
.
refundNo
)
.
refundNo
(
this
.
refundNo
)
.
createUser
(
this
.
createUser
)
.
createUser
(
this
.
createUser
)
.
voucher
(
StringUtils
.
isBlank
(
this
.
voucher
)
?
null
:
Arrays
.
asList
(
this
.
voucher
.
split
(
","
)))
.
voucher
(
StringUtils
.
isBlank
(
this
.
voucher
)
?
null
:
Arrays
.
asList
(
this
.
voucher
.
split
(
","
)))
.
cashAmt
(
this
.
cashAmt
)
.
cashAmt
(
this
.
cashAmt
)
.
payTime
(
this
.
payTime
)
.
payTime
(
this
.
payTime
)
.
remark
(
this
.
remark
)
.
remark
(
this
.
remark
)
.
build
();
.
build
();
}
}
}
}
src/main/java/com/mmc/pms/entity/ServiceDO.java
浏览文件 @
a3df433c
...
@@ -12,8 +12,8 @@ import java.util.Date;
...
@@ -12,8 +12,8 @@ import java.util.Date;
/**
/**
* @Author LW
* @Author LW
*
@date 2023/6/8 10:33
*
* 概要:
*
@date 2023/6/8 10:33
概要:
*/
*/
@Data
@Data
@AllArgsConstructor
@AllArgsConstructor
...
@@ -21,73 +21,65 @@ import java.util.Date;
...
@@ -21,73 +21,65 @@ import java.util.Date;
@Builder
@Builder
public
class
ServiceDO
implements
Serializable
{
public
class
ServiceDO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
private
Integer
id
;
private
Integer
id
;
@ApiModelProperty
(
value
=
"服务名称"
)
@ApiModelProperty
(
value
=
"服务名称"
)
private
String
serviceName
;
private
String
serviceName
;
@ApiModelProperty
(
value
=
"应用"
)
@ApiModelProperty
(
value
=
"应用"
)
private
Integer
applicationId
;
private
Integer
applicationId
;
@ApiModelProperty
(
value
=
"行业"
)
@ApiModelProperty
(
value
=
"行业"
)
private
Integer
industryId
;
private
Integer
industryId
;
@ApiModelProperty
(
value
=
"展示状态"
)
@ApiModelProperty
(
value
=
"展示状态"
)
private
Integer
displayState
;
private
Integer
displayState
;
@ApiModelProperty
(
value
=
"封面图"
)
@ApiModelProperty
(
value
=
"封面图"
)
private
String
coverPlan
;
private
String
coverPlan
;
@ApiModelProperty
(
value
=
"分享卡片"
)
@ApiModelProperty
(
value
=
"分享卡片"
)
private
String
shareCard
;
private
String
shareCard
;
@ApiModelProperty
(
value
=
"视频"
)
@ApiModelProperty
(
value
=
"视频"
)
private
String
video
;
private
String
video
;
@ApiModelProperty
(
value
=
"服务介绍"
)
@ApiModelProperty
(
value
=
"服务介绍"
)
private
String
serviceIntroduction
;
private
String
serviceIntroduction
;
@ApiModelProperty
(
value
=
"创建人id"
)
@ApiModelProperty
(
value
=
"创建人id"
)
private
Integer
accountId
;
private
Integer
accountId
;
@ApiModelProperty
(
value
=
"创建时间"
)
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createTime
;
private
Date
createTime
;
@ApiModelProperty
(
value
=
"修改时间"
)
@ApiModelProperty
(
value
=
"修改时间"
)
private
Date
updateTime
;
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"逻辑删除字段"
)
@ApiModelProperty
(
value
=
"逻辑删除字段"
)
private
Integer
isDeleted
;
private
Integer
isDeleted
;
public
ServiceDO
(
ServiceVO
param
,
Integer
accountId
)
{
public
ServiceDO
(
ServiceVO
param
,
Integer
accountId
)
{
this
.
id
=
param
.
getId
();
this
(
param
);
this
.
serviceName
=
param
.
getServiceName
();
this
.
accountId
=
accountId
;
this
.
applicationId
=
param
.
getApplicationId
();
}
this
.
industryId
=
param
.
getIndustryId
();
this
.
displayState
=
param
.
getDisplayState
();
this
.
coverPlan
=
param
.
getCoverPlan
();
this
.
shareCard
=
param
.
getShareCard
();
this
.
video
=
param
.
getVideo
();
this
.
serviceIntroduction
=
param
.
getServiceIntroduction
();
this
.
accountId
=
accountId
;
}
public
ServiceDO
(
ServiceVO
param
)
{
public
ServiceDO
(
ServiceVO
param
)
{
this
.
id
=
param
.
getId
();
this
.
id
=
param
.
getId
();
this
.
serviceName
=
param
.
getServiceName
();
this
.
serviceName
=
param
.
getServiceName
();
this
.
applicationId
=
param
.
getApplicationId
();
this
.
applicationId
=
param
.
getApplicationId
();
this
.
industryId
=
param
.
getIndustryId
();
this
.
industryId
=
param
.
getIndustryId
();
this
.
displayState
=
param
.
getDisplayState
();
this
.
displayState
=
param
.
getDisplayState
();
this
.
coverPlan
=
param
.
getCoverPlan
();
this
.
coverPlan
=
param
.
getCoverPlan
();
this
.
shareCard
=
param
.
getShareCard
();
this
.
shareCard
=
param
.
getShareCard
();
this
.
video
=
param
.
getVideo
();
this
.
video
=
param
.
getVideo
();
this
.
serviceIntroduction
=
param
.
getServiceIntroduction
();
this
.
serviceIntroduction
=
param
.
getServiceIntroduction
();
}
}
public
ServiceDO
(
Integer
id
,
Integer
accountId
)
{
public
ServiceDO
(
Integer
id
,
Integer
accountId
)
{
this
.
id
=
id
;
this
.
id
=
id
;
this
.
accountId
=
accountId
;
this
.
accountId
=
accountId
;
}
}
}
}
src/main/java/com/mmc/pms/feign/UserAppApi.java
0 → 100644
浏览文件 @
a3df433c
package
com
.
mmc
.
pms
.
feign
;
import
com.mmc.pms.auth.dto.BUserAccountQO
;
import
com.mmc.pms.auth.dto.UserAccountSimpleDTO
;
import
com.mmc.pms.feign.hystrix.UserAppApiHystrix
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* @author: zj
* @Date: 2023/5/18 17:06
*/
//@FeignClient(name = "cms-svc", fallback = UserAppApiHystrix.class)
@FeignClient
(
url
=
"${iuav.userapp.url}"
,
name
=
"cms-svc"
,
fallback
=
UserAppApiHystrix
.
class
)
public
interface
UserAppApi
{
/**
* 根据用户id获取基本信息
*
* @param userAccountId
* @return
*/
@RequestMapping
(
value
=
"/userapp/user-account/feignGetUserSimpleInfo"
,
method
=
RequestMethod
.
GET
)
public
UserAccountSimpleDTO
feignGetUserSimpleInfo
(
@RequestParam
Integer
userAccountId
,
@RequestHeader
(
"token"
)
String
token
);
/**
* 根据地区信息查询用户id
*
* @param provinceCode
* @param cityCode
* @param districtCode
* @return
*/
@GetMapping
(
"/userapp/user-account/feignListUserAccountIds"
)
List
<
Integer
>
feignListUserAccountIds
(
@RequestParam
Integer
provinceCode
,
@RequestParam
(
required
=
false
)
Integer
cityCode
,
@RequestParam
(
required
=
false
)
Integer
districtCode
,
@RequestHeader
(
value
=
"token"
,
required
=
false
)
String
token
);
/**
* 获取用户集合列表页面
*
* @param bUserAccountQO 问:b用户帐户
* @return {@link List}<{@link UserAccountSimpleDTO}>
*/
@PostMapping
(
"/userapp/back-user/feignListBAccountPage"
)
List
<
UserAccountSimpleDTO
>
feignListBAccountPage
(
@ApiParam
(
value
=
"账号查询QO"
,
required
=
true
)
@RequestBody
BUserAccountQO
bUserAccountQO
,
@RequestHeader
(
"token"
)
String
token
);
}
src/main/java/com/mmc/pms/feign/config/FeignConfiguration.java
0 → 100644
浏览文件 @
a3df433c
package
com
.
mmc
.
pms
.
feign
.
config
;
import
com.mmc.pms.feign.hystrix.UserAppApiHystrix
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.Configuration
;
/**
* @author: zj
* @Date: 2023/5/18 18:21
*/
@ComponentScan
(
basePackages
=
"com.mmc.pms.feign"
)
@Configuration
public
class
FeignConfiguration
{
@Bean
(
name
=
"userAppApiHystrix"
)
public
UserAppApiHystrix
userAppApi
()
{
return
new
UserAppApiHystrix
();
}
}
src/main/java/com/mmc/pms/feign/hystrix/UserAppApiHystrix.java
0 → 100644
浏览文件 @
a3df433c
package
com
.
mmc
.
pms
.
feign
.
hystrix
;
import
com.mmc.pms.auth.dto.BUserAccountQO
;
import
com.mmc.pms.auth.dto.UserAccountSimpleDTO
;
import
com.mmc.pms.feign.UserAppApi
;
import
lombok.extern.slf4j.Slf4j
;
import
java.util.List
;
/**
* @author: zj
* @Date: 2023/5/18 17:08
*/
@Slf4j
public
class
UserAppApiHystrix
implements
UserAppApi
{
@Override
public
UserAccountSimpleDTO
feignGetUserSimpleInfo
(
Integer
userAccountId
,
String
token
)
{
log
.
error
(
"熔断:feignGetUserSimpleInfo:{}"
,
userAccountId
);
return
null
;
}
@Override
public
List
<
Integer
>
feignListUserAccountIds
(
Integer
provinceCode
,
Integer
cityCode
,
Integer
districtCode
,
String
token
)
{
log
.
error
(
"熔断:feignListUserAccountIds:{}, {}, {}"
,
provinceCode
,
cityCode
,
districtCode
);
return
null
;
}
@Override
public
List
<
UserAccountSimpleDTO
>
feignListBAccountPage
(
BUserAccountQO
bUserAccountQO
,
String
token
)
{
log
.
error
(
"熔断:feignListBAccountPage:{}"
,
bUserAccountQO
);
return
null
;
}
}
src/main/java/com/mmc/pms/json/JsonUtil.java
浏览文件 @
a3df433c
...
@@ -13,107 +13,107 @@ import java.util.List;
...
@@ -13,107 +13,107 @@ import java.util.List;
*/
*/
public
class
JsonUtil
{
public
class
JsonUtil
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
String
array
=
"[1,24,23]"
;
String
array
=
"[1,24,23]"
;
List
<
Integer
>
list
=
JSONArray
.
parseArray
(
array
,
Integer
.
class
);
List
<
Integer
>
list
=
JSONArray
.
parseArray
(
array
,
Integer
.
class
);
System
.
out
.
println
(
list
.
get
(
2
));
System
.
out
.
println
(
list
.
get
(
2
));
}
}
/**
/**
* 把Java对象转换成json字符串
* 把Java对象转换成json字符串
*
*
* @param object 待转化为JSON字符串的Java对象
* @param object 待转化为JSON字符串的Java对象
* @return json 串 or null
* @return json 串 or null
*/
*/
public
static
String
parseObjToJson
(
Object
object
)
{
public
static
String
parseObjToJson
(
Object
object
)
{
String
string
=
null
;
String
string
=
null
;
try
{
try
{
string
=
JSONObject
.
toJSONString
(
object
);
string
=
JSONObject
.
toJSONString
(
object
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// LOGGER.error(e.getMessage());
// LOGGER.error(e.getMessage());
}
return
string
;
}
}
return
string
;
}
/**
/**
* 将Json字符串信息转换成对应的Java对象
* 将Json字符串信息转换成对应的Java对象
*
*
* @param json json字符串对象
* @param json json字符串对象
* @param c 对应的类型
* @param c 对应的类型
*/
*/
public
static
<
T
>
T
parseJsonToObj
(
String
json
,
Class
<
T
>
c
)
{
public
static
<
T
>
T
parseJsonToObj
(
String
json
,
Class
<
T
>
c
)
{
try
{
try
{
JSONObject
jsonObject
=
JSON
.
parseObject
(
json
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
json
);
return
JSON
.
toJavaObject
(
jsonObject
,
c
);
return
JSON
.
toJavaObject
(
jsonObject
,
c
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// LOGGER.error(e.getMessage());
// LOGGER.error(e.getMessage());
}
return
null
;
}
}
return
null
;
}
/**
/**
* 读取json文件
* 读取json文件
*
*
* @param fileName
* @param fileName
* @return
* @return
*/
*/
public
static
String
readJsonFile
(
String
fileName
)
{
public
static
String
readJsonFile
(
String
fileName
)
{
String
jsonStr
=
""
;
String
jsonStr
=
""
;
try
{
try
{
File
jsonFile
=
new
File
(
fileName
);
File
jsonFile
=
new
File
(
fileName
);
FileReader
fileReader
=
new
FileReader
(
jsonFile
);
FileReader
fileReader
=
new
FileReader
(
jsonFile
);
Reader
reader
=
new
InputStreamReader
(
new
FileInputStream
(
jsonFile
),
"utf-8"
);
Reader
reader
=
new
InputStreamReader
(
new
FileInputStream
(
jsonFile
),
"utf-8"
);
int
ch
=
0
;
int
ch
=
0
;
StringBuffer
sb
=
new
StringBuffer
();
StringBuffer
sb
=
new
StringBuffer
();
while
((
ch
=
reader
.
read
())
!=
-
1
)
{
while
((
ch
=
reader
.
read
())
!=
-
1
)
{
sb
.
append
((
char
)
ch
);
sb
.
append
((
char
)
ch
);
}
}
fileReader
.
close
();
fileReader
.
close
();
reader
.
close
();
reader
.
close
();
jsonStr
=
sb
.
toString
();
jsonStr
=
sb
.
toString
();
return
jsonStr
;
return
jsonStr
;
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
return
null
;
return
null
;
}
}
}
}
/**
/**
* 将JSON数据格式化并保存到文件中
* 将JSON数据格式化并保存到文件中
*
*
* @param jsonData 需要输出的json数
* @param jsonData 需要输出的json数
* @param filePath 输出的文件地址
* @param filePath 输出的文件地址
* @return
* @return
*/
*/
public
static
boolean
createJsonFile
(
Object
jsonData
,
String
filePath
)
{
public
static
boolean
createJsonFile
(
Object
jsonData
,
String
filePath
)
{
String
content
=
String
content
=
JSON
.
toJSONString
(
JSON
.
toJSONString
(
jsonData
,
jsonData
,
SerializerFeature
.
PrettyFormat
,
SerializerFeature
.
PrettyFormat
,
SerializerFeature
.
WriteMapNullValue
,
SerializerFeature
.
WriteMapNullValue
,
SerializerFeature
.
WriteDateUseDateFormat
);
SerializerFeature
.
WriteDateUseDateFormat
);
// 标记文件生成是否成功
// 标记文件生成是否成功
boolean
flag
=
true
;
boolean
flag
=
true
;
// 生成json格式文件
// 生成json格式文件
try
{
try
{
// 保证创建一个新文件
// 保证创建一个新文件
File
file
=
new
File
(
filePath
);
File
file
=
new
File
(
filePath
);
if
(!
file
.
getParentFile
().
exists
())
{
// 如果父目录不存在,创建父目录
if
(!
file
.
getParentFile
().
exists
())
{
// 如果父目录不存在,创建父目录
file
.
getParentFile
().
mkdirs
();
file
.
getParentFile
().
mkdirs
();
}
}
if
(
file
.
exists
())
{
// 如果已存在,删除旧文件
if
(
file
.
exists
())
{
// 如果已存在,删除旧文件
file
.
delete
();
file
.
delete
();
}
}
file
.
createNewFile
();
file
.
createNewFile
();
// 将格式化后的字符串写入文件
// 将格式化后的字符串写入文件
Writer
write
=
new
OutputStreamWriter
(
new
FileOutputStream
(
file
),
"UTF-8"
);
Writer
write
=
new
OutputStreamWriter
(
new
FileOutputStream
(
file
),
"UTF-8"
);
write
.
write
(
content
);
write
.
write
(
content
);
write
.
flush
();
write
.
flush
();
write
.
close
();
write
.
close
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
flag
=
false
;
flag
=
false
;
e
.
printStackTrace
();
e
.
printStackTrace
();
}
return
flag
;
}
}
return
flag
;
}
}
}
src/main/java/com/mmc/pms/model/categories/dto/AllCategoryDTO.java
0 → 100644
浏览文件 @
a3df433c
/**
* Copyright 2023 bejson.com
*/
package
com
.
mmc
.
pms
.
model
.
categories
.
dto
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
/**
* Auto-generated: 2023-06-08 16:2:43
*
* @author 23214
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public
class
AllCategoryDTO
{
private
Integer
directoryId
;
private
String
name
;
private
List
<
CategoriesInfoListDTO
>
categoriesInfoListDTO
;
}
\ No newline at end of file
src/main/java/com/mmc/pms/model/categories/dto/CategoriesDTO.java
0 → 100644
浏览文件 @
a3df433c
package
com
.
mmc
.
pms
.
model
.
categories
.
dto
;
import
com.mmc.pms.entity.Categories
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
/**
* @author lw
* @TableName categories
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
CategoriesDTO
implements
Serializable
{
private
Integer
id
;
@ApiModelProperty
(
value
=
"分类名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"分类类型"
)
private
Integer
type
;
public
CategoriesDTO
(
Categories
categories
)
{
this
.
id
=
categories
.
getId
();
this
.
name
=
categories
.
getName
();
this
.
type
=
categories
.
getType
();
}
}
\ No newline at end of file
src/main/java/com/mmc/pms/model/categories/dto/CategoriesInfoListDTO.java
0 → 100644
浏览文件 @
a3df433c
/**
* Copyright 2023 bejson.com
*/
package
com
.
mmc
.
pms
.
model
.
categories
.
dto
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* Auto-generated: 2023-06-08 16:2:43
*
* @author bejson.com (i@bejson.com)
* @website http://www.bejson.com/java2pojo/
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public
class
CategoriesInfoListDTO
{
private
Integer
id
;
private
Integer
directoryId
;
private
String
name
;
private
String
icon
;
}
\ No newline at end of file
src/main/java/com/mmc/pms/model/lease/dto/LeaseGoodsInfoDTO.java
0 → 100644
浏览文件 @
a3df433c
package
com
.
mmc
.
pms
.
model
.
lease
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
/**
* @Author small @Date 2023/5/16 9:53 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
LeaseGoodsInfoDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
4354269497656808831L
;
@ApiModelProperty
(
value
=
"id"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"商品名称"
)
private
String
goodsName
;
@ApiModelProperty
(
value
=
"商品图片"
)
private
String
images
;
@ApiModelProperty
(
value
=
"价格"
)
private
BigDecimal
price
;
}
src/main/java/com/mmc/pms/model/qo/GoodsInfoQO.java
浏览文件 @
a3df433c
package
com
.
mmc
.
pms
.
model
.
qo
;
package
com
.
mmc
.
pms
.
model
.
qo
;
import
com.mmc.pms.common.Page
;
import
com.mmc.pms.model.group.Freeze
;
import
com.mmc.pms.model.group.Freeze
;
import
com.mmc.pms.page.Page
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Builder
;
...
...
src/main/java/com/mmc/pms/model/qo/IndustrySkuQO.java
浏览文件 @
a3df433c
package
com
.
mmc
.
pms
.
model
.
qo
;
package
com
.
mmc
.
pms
.
model
.
qo
;
import
com.mmc.pms.common.Page
;
import
com.mmc.pms.model.group.Freeze
;
import
com.mmc.pms.model.group.Freeze
;
import
com.mmc.pms.page.Page
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Data
;
...
...
src/main/java/com/mmc/pms/model/qo/ProductSkuQO.java
浏览文件 @
a3df433c
package
com
.
mmc
.
pms
.
model
.
qo
;
package
com
.
mmc
.
pms
.
model
.
qo
;
import
com.mmc.pms.common.Page
;
import
com.mmc.pms.model.group.Freeze
;
import
com.mmc.pms.model.group.Freeze
;
import
com.mmc.pms.page.Page
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Data
;
...
...
src/main/java/com/mmc/pms/model/qo/ServiceQO.java
浏览文件 @
a3df433c
package
com
.
mmc
.
pms
.
model
.
qo
;
package
com
.
mmc
.
pms
.
model
.
qo
;
import
com.mmc.pms.common.Page
;
import
com.mmc.pms.common.Page
;
import
com.mmc.pms.model.group.Freeze
;
import
com.mmc.pms.model.group.Freeze
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
...
@@ -16,8 +15,8 @@ import java.io.Serializable;
...
@@ -16,8 +15,8 @@ import java.io.Serializable;
/**
/**
* @Author LW
* @Author LW
*
@date 2023/6/8 10:33
*
* 概要:
*
@date 2023/6/8 10:33
概要:
*/
*/
@Data
@Data
@AllArgsConstructor
@AllArgsConstructor
...
@@ -25,28 +24,38 @@ import java.io.Serializable;
...
@@ -25,28 +24,38 @@ import java.io.Serializable;
@Builder
@Builder
public
class
ServiceQO
implements
Serializable
{
public
class
ServiceQO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
private
Integer
id
;
private
Integer
id
;
@ApiModelProperty
(
value
=
"服务名称"
,
example
=
"服务名称"
)
@Length
(
message
=
"最大不超过30字"
,
max
=
30
)
private
String
serviceName
;
@ApiModelProperty
(
value
=
"服务名称"
,
example
=
"服务名称"
)
@ApiModelProperty
(
value
=
"应用"
,
example
=
"1"
)
@Length
(
message
=
"最大不超过30字"
,
max
=
30
)
private
Integer
applicationId
;
private
String
serviceName
;
@ApiModelProperty
(
value
=
"应用"
,
example
=
"1
"
)
@ApiModelProperty
(
value
=
"行业"
,
example
=
"2
"
)
private
Integer
application
Id
;
private
Integer
industry
Id
;
@ApiModelProperty
(
value
=
"行业"
,
example
=
"2
"
)
@ApiModelProperty
(
value
=
"账号id
"
)
private
Integer
industry
Id
;
private
Integer
account
Id
;
@ApiModelProperty
(
value
=
"页码"
,
required
=
true
)
@ApiModelProperty
(
value
=
"页码"
,
required
=
true
)
@NotNull
(
message
=
"页码不能为空"
,
groups
=
{
Page
.
class
,
Freeze
.
class
})
@NotNull
(
@Min
(
value
=
1
,
groups
=
Page
.
class
)
message
=
"页码不能为空"
,
private
Integer
pageNo
;
groups
=
{
Page
.
class
,
Freeze
.
class
})
@Min
(
value
=
1
,
groups
=
Page
.
class
)
private
Integer
pageNo
;
@ApiModelProperty
(
value
=
"每页显示数"
,
required
=
true
)
@ApiModelProperty
(
value
=
"每页显示数"
,
required
=
true
)
@NotNull
(
message
=
"每页显示数不能为空"
,
groups
=
{
Page
.
class
,
Freeze
.
class
})
@NotNull
(
@Min
(
value
=
1
,
groups
=
Page
.
class
)
message
=
"每页显示数不能为空"
,
private
Integer
pageSize
;
groups
=
{
Page
.
class
,
Freeze
.
class
})
@Min
(
value
=
1
,
groups
=
Page
.
class
)
private
Integer
pageSize
;
public
void
buildCurrentPage
()
{
this
.
pageNo
=
(
pageNo
-
1
)
*
pageSize
;
}
}
}
src/main/java/com/mmc/pms/model/qo/WareInfoQO.java
浏览文件 @
a3df433c
package
com
.
mmc
.
pms
.
model
.
qo
;
package
com
.
mmc
.
pms
.
model
.
qo
;
import
com.mmc.pms.
page
.Page
;
import
com.mmc.pms.
common
.Page
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -9,6 +9,7 @@ import lombok.NoArgsConstructor;
...
@@ -9,6 +9,7 @@ import lombok.NoArgsConstructor;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.List
;
/**
/**
* @Author small @Date 2023/5/16 9:55 @Version 1.0
* @Author small @Date 2023/5/16 9:55 @Version 1.0
...
@@ -18,45 +19,25 @@ import java.io.Serializable;
...
@@ -18,45 +19,25 @@ import java.io.Serializable;
@NoArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.qo.WareInfoQO", description = "model")
// @ApiModel(value = "com.mmc.csf.model.qo.WareInfoQO", description = "model")
public
class
WareInfoQO
implements
Serializable
{
public
class
WareInfoQO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
2953141525621912414L
;
private
static
final
long
serialVersionUID
=
-
2953141525621912414L
;
@ApiModelProperty
(
name
=
"id"
,
value
=
"设备
id"
,
example
=
"1"
,
required
=
false
)
@ApiModelProperty
(
name
=
"districtId"
,
value
=
"地域
id"
,
example
=
"1"
,
required
=
false
)
private
Integer
i
d
;
private
Integer
provinceI
d
;
@ApiModelProperty
(
name
=
"districtId"
,
value
=
"地域id"
,
example
=
"1"
,
required
=
false
)
@ApiModelProperty
(
name
=
"categoryId"
,
value
=
"分类id"
)
private
Integer
district
Id
;
private
List
<
Integer
>
category
Id
;
@ApiModelProperty
(
name
=
"categoryId"
,
value
=
"类目id"
,
example
=
"类目id"
)
@ApiModelProperty
(
value
=
"页码"
,
required
=
true
)
private
Integer
categoryId
;
@NotNull
(
message
=
"页码不能为空"
,
groups
=
Page
.
class
)
@Min
(
value
=
1
,
groups
=
Page
.
class
)
private
Integer
pageNo
;
@ApiModelProperty
(
name
=
"brandIdl"
,
value
=
"品牌id"
,
example
=
"品牌id"
)
@ApiModelProperty
(
value
=
"每页显示数"
,
required
=
true
)
private
Integer
brandId
;
@NotNull
(
message
=
"每页显示数不能为空"
,
groups
=
Page
.
class
)
@Min
(
value
=
1
,
groups
=
Page
.
class
)
private
Integer
pageSize
;
@ApiModelProperty
(
name
=
"modelId"
,
value
=
"型号id"
,
example
=
"型号id"
)
public
void
buildCurrentPage
()
{
private
Integer
modelId
;
this
.
pageNo
=
(
pageNo
-
1
)
*
pageSize
;
/*@ApiModelProperty(value = "关键字")
}
private String keyword;
@ApiModelProperty(value = "商品状态,出租中或仓库中")
private Integer wareStatus;
@ApiModelProperty(value = "商品类型")
private Integer wareTypeId;
@ApiModelProperty(value = "活动属性")
private Integer propInfoId;*/
@ApiModelProperty
(
value
=
"页码"
,
required
=
true
)
@NotNull
(
message
=
"页码不能为空"
,
groups
=
Page
.
class
)
@Min
(
value
=
1
,
groups
=
Page
.
class
)
private
Integer
pageNo
;
@ApiModelProperty
(
value
=
"每页显示数"
,
required
=
true
)
@NotNull
(
message
=
"每页显示数不能为空"
,
groups
=
Page
.
class
)
@Min
(
value
=
1
,
groups
=
Page
.
class
)
private
Integer
pageSize
;
public
void
buildCurrentPage
()
{
this
.
pageNo
=
(
pageNo
-
1
)
*
pageSize
;
}
}
}
src/main/java/com/mmc/pms/model/sale/vo/QueryClassifyVO.java
浏览文件 @
a3df433c
package
com
.
mmc
.
pms
.
model
.
sale
.
vo
;
package
com
.
mmc
.
pms
.
model
.
sale
.
vo
;
import
com.mmc.pms.common.Page
;
import
com.mmc.pms.model.group.Create
;
import
com.mmc.pms.model.group.Create
;
import
com.mmc.pms.model.group.Freeze
;
import
com.mmc.pms.model.group.Freeze
;
import
com.mmc.pms.model.group.Update
;
import
com.mmc.pms.model.group.Update
;
import
com.mmc.pms.page.Page
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Data
;
...
...
src/main/java/com/mmc/pms/model/work/dto/ServiceDTO.java
0 → 100644
浏览文件 @
a3df433c
package
com
.
mmc
.
pms
.
model
.
work
.
dto
;
import
com.mmc.pms.entity.ServiceDO
;
import
com.mmc.pms.model.work.vo.ServiceVO
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* @Author LW
* @date 2023/6/8 10:33
* 概要:
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
ServiceDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
Integer
id
;
@ApiModelProperty
(
value
=
"服务名称"
)
private
String
serviceName
;
@ApiModelProperty
(
value
=
"应用"
)
private
Integer
applicationId
;
@ApiModelProperty
(
value
=
"应用名称"
)
private
String
applicationName
;
@ApiModelProperty
(
value
=
"行业"
)
private
Integer
industryId
;
@ApiModelProperty
(
value
=
"行业名称"
)
private
String
industryName
;
@ApiModelProperty
(
value
=
"展示状态"
)
private
Integer
displayState
;
@ApiModelProperty
(
value
=
"封面图"
)
private
String
coverPlan
;
@ApiModelProperty
(
value
=
"分享卡片"
)
private
String
shareCard
;
@ApiModelProperty
(
value
=
"视频"
)
private
String
video
;
@ApiModelProperty
(
value
=
"服务介绍"
)
private
String
serviceIntroduction
;
@ApiModelProperty
(
value
=
"账号id"
)
private
Integer
accountId
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"修改时间"
)
private
Date
updateTime
;
public
ServiceDTO
(
ServiceVO
param
,
Integer
accountId
)
{
this
.
id
=
param
.
getId
();
this
.
serviceName
=
param
.
getServiceName
();
this
.
applicationId
=
param
.
getApplicationId
();
this
.
industryId
=
param
.
getIndustryId
();
this
.
displayState
=
param
.
getDisplayState
();
this
.
coverPlan
=
param
.
getCoverPlan
();
this
.
shareCard
=
param
.
getShareCard
();
this
.
video
=
param
.
getVideo
();
this
.
serviceIntroduction
=
param
.
getServiceIntroduction
();
this
.
accountId
=
accountId
;
}
public
ServiceDTO
(
ServiceVO
param
)
{
this
.
id
=
param
.
getId
();
this
.
serviceName
=
param
.
getServiceName
();
this
.
applicationId
=
param
.
getApplicationId
();
this
.
industryId
=
param
.
getIndustryId
();
this
.
displayState
=
param
.
getDisplayState
();
this
.
coverPlan
=
param
.
getCoverPlan
();
this
.
shareCard
=
param
.
getShareCard
();
this
.
video
=
param
.
getVideo
();
this
.
serviceIntroduction
=
param
.
getServiceIntroduction
();
}
public
ServiceDTO
(
Integer
id
,
Integer
accountId
)
{
this
.
id
=
id
;
this
.
accountId
=
accountId
;
}
public
ServiceDTO
(
ServiceDO
serviceDO
)
{
this
.
id
=
serviceDO
.
getId
();
this
.
serviceName
=
serviceDO
.
getServiceName
();
this
.
applicationId
=
serviceDO
.
getApplicationId
();
this
.
industryId
=
serviceDO
.
getIndustryId
();
this
.
displayState
=
serviceDO
.
getDisplayState
();
this
.
coverPlan
=
serviceDO
.
getCoverPlan
();
this
.
shareCard
=
serviceDO
.
getShareCard
();
this
.
video
=
serviceDO
.
getVideo
();
this
.
serviceIntroduction
=
serviceDO
.
getServiceIntroduction
();
this
.
accountId
=
serviceDO
.
getAccountId
();
this
.
createTime
=
serviceDO
.
getCreateTime
();
this
.
updateTime
=
serviceDO
.
getUpdateTime
();
}
}
src/main/java/com/mmc/pms/model/work/vo/ServiceVO.java
浏览文件 @
a3df433c
...
@@ -15,8 +15,8 @@ import java.io.Serializable;
...
@@ -15,8 +15,8 @@ import java.io.Serializable;
/**
/**
* @Author LW
* @Author LW
*
@date 2023/6/8 10:33
*
* 概要:
*
@date 2023/6/8 10:33
概要:
*/
*/
@Data
@Data
@AllArgsConstructor
@AllArgsConstructor
...
@@ -24,37 +24,47 @@ import java.io.Serializable;
...
@@ -24,37 +24,47 @@ import java.io.Serializable;
@Builder
@Builder
public
class
ServiceVO
implements
Serializable
{
public
class
ServiceVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
@NotNull
(
message
=
"修改服务id不能为空"
,
groups
=
{
Update
.
class
})
@NotNull
(
private
Integer
id
;
message
=
"修改服务id不能为空"
,
groups
=
{
Update
.
class
})
private
Integer
id
;
@ApiModelProperty
(
value
=
"服务名称"
,
example
=
"服务名称"
)
@ApiModelProperty
(
value
=
"服务名称"
,
example
=
"服务名称"
)
@NotBlank
(
message
=
"服务名称不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
@NotBlank
(
@Length
(
message
=
"最大不超过30字"
,
max
=
30
)
message
=
"服务名称不能为空"
,
private
String
serviceName
;
groups
=
{
Create
.
class
,
Update
.
class
})
@Length
(
message
=
"最大不超过30字"
,
max
=
30
)
private
String
serviceName
;
@ApiModelProperty
(
value
=
"应用"
,
example
=
"1"
)
@ApiModelProperty
(
value
=
"应用"
,
example
=
"1"
)
private
Integer
applicationId
;
private
Integer
applicationId
;
@ApiModelProperty
(
value
=
"行业"
,
example
=
"2"
)
@ApiModelProperty
(
value
=
"行业"
,
example
=
"2"
)
@NotNull
(
message
=
"行业id不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
@NotNull
(
private
Integer
industryId
;
message
=
"行业id不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
industryId
;
@ApiModelProperty
(
value
=
"展示状态,0为上架,1下架"
,
example
=
"0"
)
@ApiModelProperty
(
value
=
"展示状态,0为上架,1下架"
,
example
=
"0"
)
@NotNull
(
message
=
"展示状态不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
@NotNull
(
private
Integer
displayState
;
message
=
"展示状态不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
Integer
displayState
;
@ApiModelProperty
(
value
=
"封面图"
)
@ApiModelProperty
(
value
=
"封面图"
)
@NotBlank
(
message
=
"封面图不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
@NotBlank
(
private
String
coverPlan
;
message
=
"封面图不能为空"
,
groups
=
{
Create
.
class
,
Update
.
class
})
private
String
coverPlan
;
@ApiModelProperty
(
value
=
"分享卡片"
)
@ApiModelProperty
(
value
=
"分享卡片"
)
private
String
shareCard
;
private
String
shareCard
;
@ApiModelProperty
(
value
=
"视频"
)
@ApiModelProperty
(
value
=
"视频"
)
private
String
video
;
private
String
video
;
@ApiModelProperty
(
value
=
"服务介绍"
)
@ApiModelProperty
(
value
=
"服务介绍"
)
private
String
serviceIntroduction
;
private
String
serviceIntroduction
;
}
}
src/main/java/com/mmc/pms/page/Page.java
deleted
100644 → 0
浏览文件 @
ea4eb88b
package
com
.
mmc
.
pms
.
page
;
/**
* @Author small @Date 2023/5/16 10:09 @Version 1.0
*/
public
interface
Page
{}
src/main/java/com/mmc/pms/service/BackstageTaskService.java
浏览文件 @
a3df433c
package
com
.
mmc
.
pms
.
service
;
package
com
.
mmc
.
pms
.
service
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.model.qo.ServiceQO
;
import
com.mmc.pms.model.qo.ServiceQO
;
import
com.mmc.pms.model.work.vo.ServiceVO
;
import
com.mmc.pms.model.work.vo.ServiceVO
;
import
com.mmc.pms.page.PageResult
;
/**
/**
* @Author LW
* @Author LW
*
@date 2023/6/6 10:46
*
* 概要:
*
@date 2023/6/6 10:46
概要:
*/
*/
public
interface
BackstageTaskService
{
public
interface
BackstageTaskService
{
ResultBody
addWorkService
(
ServiceVO
param
,
Integer
userAccountId
);
ResultBody
addWorkService
(
ServiceVO
param
,
Integer
userAccountId
);
ResultBody
updateById
(
ServiceVO
param
);
ResultBody
updateById
(
ServiceVO
param
);
ResultBody
deleteById
(
Integer
id
);
ResultBody
deleteById
(
Integer
id
);
ResultBody
queryById
(
Integer
id
);
ResultBody
queryById
(
Integer
id
);
ResultBody
queryWorkServiceList
(
ServiceQO
param
,
Integer
userAccountId
);
PageResult
queryWorkServiceList
(
ServiceQO
param
,
Integer
userAccountId
);
}
}
src/main/java/com/mmc/pms/service/CategoriesService.java
浏览文件 @
a3df433c
package
com
.
mmc
.
pms
.
service
;
package
com
.
mmc
.
pms
.
service
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.entity.Categories
;
import
com.mmc.pms.entity.DirectoryDO
;
import
com.mmc.pms.entity.DistrictDO
;
import
com.mmc.pms.model.categories.vo.CategoriesInfoVO
;
import
com.mmc.pms.model.categories.vo.ClassifyInfoVO
;
import
com.mmc.pms.model.categories.vo.ClassifyInfoVO
;
import
com.mmc.pms.model.categories.vo.DirectoryInfoVO
;
import
com.mmc.pms.model.categories.vo.DirectoryInfoVO
;
import
com.mmc.pms.model.sale.vo.QueryClassifyVO
;
import
com.mmc.pms.model.sale.vo.QueryClassifyVO
;
import
com.mmc.pms.page.PageResult
;
import
com.mmc.pms.page.PageResult
;
import
java.util.List
;
import
java.util.Set
;
/**
/**
* @author 23214
* @author 23214
* @description 针对表【categories(通用分类表)】的数据库操作Service
* @description 针对表【categories(通用分类表)】的数据库操作Service
...
@@ -34,4 +41,13 @@ public interface CategoriesService {
...
@@ -34,4 +41,13 @@ public interface CategoriesService {
ResultBody
deleteRelevantBusiness
(
Integer
id
);
ResultBody
deleteRelevantBusiness
(
Integer
id
);
ResultBody
getDirectoryList
(
Integer
type
);
ResultBody
getDirectoryList
(
Integer
type
);
ResultBody
queryCategoryInfoByType
(
Integer
type
);
List
<
Categories
>
getCategoriesListByDirectoryName
(
String
directoryName
);
ResultBody
getApplicationList
(
String
directoryName
);
List
<
Categories
>
getCategoriesListByIds
(
Set
<
Integer
>
ids
);
}
}
src/main/java/com/mmc/pms/service/Impl/BackstageTaskServiceImpl.java
浏览文件 @
a3df433c
...
@@ -2,55 +2,108 @@ package com.mmc.pms.service.Impl;
...
@@ -2,55 +2,108 @@ package com.mmc.pms.service.Impl;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.dao.BackstageTaskServiceDao
;
import
com.mmc.pms.dao.BackstageTaskServiceDao
;
import
com.mmc.pms.dao.CategoriesDao
;
import
com.mmc.pms.entity.Categories
;
import
com.mmc.pms.entity.ServiceDO
;
import
com.mmc.pms.entity.ServiceDO
;
import
com.mmc.pms.model.qo.ServiceQO
;
import
com.mmc.pms.model.qo.ServiceQO
;
import
com.mmc.pms.model.work.dto.ServiceDTO
;
import
com.mmc.pms.model.work.vo.ServiceVO
;
import
com.mmc.pms.model.work.vo.ServiceVO
;
import
com.mmc.pms.page.PageResult
;
import
com.mmc.pms.service.BackstageTaskService
;
import
com.mmc.pms.service.BackstageTaskService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.util.List
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
/**
* @Author LW
* @Author LW
*
@date 2023/6/8 9:59
*
* 概要:
*
@date 2023/6/8 9:59
概要:
*/
*/
@Service
@Service
public
class
BackstageTaskServiceImpl
implements
BackstageTaskService
{
public
class
BackstageTaskServiceImpl
implements
BackstageTaskService
{
@Autowired
@Autowired
private
BackstageTaskServiceDao
backstageTaskServiceDao
;
private
BackstageTaskServiceDao
backstageTaskServiceDao
;
@Override
@Autowired
private
CategoriesDao
categoriesDao
;
public
ResultBody
addWorkService
(
ServiceVO
param
,
Integer
userAccountId
)
{
ServiceDO
serviceDO
=
new
ServiceDO
(
param
,
userAccountId
);
backstageTaskServiceDao
.
insert
(
serviceDO
);
return
ResultBody
.
success
();
}
@Override
@Override
public
ResultBody
updateById
(
ServiceVO
param
)
{
public
ResultBody
addWorkService
(
ServiceVO
param
,
Integer
userAccountId
)
{
ServiceDO
serviceDO
=
new
ServiceDO
(
param
);
ServiceDO
serviceDO
=
new
ServiceDO
(
param
,
userAccountId
);
backstageTaskServiceDao
.
update
(
serviceDO
);
backstageTaskServiceDao
.
insert
(
serviceDO
);
return
ResultBody
.
success
();
return
ResultBody
.
success
();
}
}
@Override
public
ResultBody
updateById
(
ServiceVO
param
)
{
ServiceDO
serviceDO
=
new
ServiceDO
(
param
);
backstageTaskServiceDao
.
update
(
serviceDO
);
return
ResultBody
.
success
();
}
@Override
public
ResultBody
deleteById
(
Integer
id
)
{
backstageTaskServiceDao
.
deleteById
(
id
);
return
ResultBody
.
success
();
}
@Override
@Override
public
ResultBody
deleteById
(
Integer
id
)
{
public
ResultBody
queryById
(
Integer
id
)
{
backstageTaskServiceDao
.
deleteById
(
id
);
ServiceDO
serviceDO
=
backstageTaskServiceDao
.
queryById
(
id
);
return
ResultBody
.
success
();
ServiceDTO
serviceDTO
=
new
ServiceDTO
(
serviceDO
);
Map
<
Integer
,
String
>
categoriesNameMap
=
getCategoriesNameByIds
(
Arrays
.
asList
(
serviceDTO
.
getApplicationId
(),
serviceDTO
.
getIndustryId
()));
if
(!
CollectionUtils
.
isEmpty
(
categoriesNameMap
))
{
serviceDTO
.
setApplicationName
(
categoriesNameMap
.
get
(
serviceDTO
.
getApplicationId
()));
serviceDTO
.
setIndustryName
(
categoriesNameMap
.
get
(
serviceDTO
.
getIndustryId
()));
}
}
return
ResultBody
.
success
(
serviceDTO
);
}
@Override
private
Map
<
Integer
,
String
>
getCategoriesNameByIds
(
List
<
Integer
>
ids
)
{
public
ResultBody
queryById
(
Integer
id
)
{
if
(
CollectionUtils
.
isEmpty
(
ids
))
{
ServiceDO
serviceDO
=
backstageTaskServiceDao
.
queryById
(
id
);
return
new
HashMap
<>();
return
ResultBody
.
success
(
serviceDO
);
}
}
Set
<
Integer
>
idSet
=
new
HashSet
<>();
for
(
Integer
id
:
ids
)
{
idSet
.
add
(
id
);
}
List
<
Categories
>
categories
=
categoriesDao
.
getCategoriesListByIds
(
idSet
);
if
(
CollectionUtils
.
isEmpty
(
categories
))
{
return
new
HashMap
<>();
}
return
categories
.
stream
()
.
collect
(
Collectors
.
toMap
(
Categories:
:
getId
,
d
->
d
.
getName
(),
(
k1
,
k2
)
->
k1
));
}
@Override
@Override
public
ResultBody
queryWorkServiceList
(
ServiceQO
param
,
Integer
userAccountId
)
{
public
PageResult
queryWorkServiceList
(
ServiceQO
param
,
Integer
userAccountId
)
{
List
<
ServiceDO
>
services
=
backstageTaskServiceDao
.
queryAllByLimit
(
param
);
int
count
=
backstageTaskServiceDao
.
count
(
param
);
return
null
;
if
(
count
==
0
)
{
return
PageResult
.
buildPage
(
param
.
getPageNo
(),
param
.
getPageSize
(),
count
);
}
Integer
pageNo
=
param
.
getPageNo
();
param
.
buildCurrentPage
();
List
<
ServiceDO
>
services
=
backstageTaskServiceDao
.
queryAllByLimit
(
param
);
List
<
Integer
>
list
=
new
ArrayList
<>();
for
(
ServiceDO
service
:
services
)
{
list
.
add
(
service
.
getApplicationId
());
list
.
add
(
service
.
getIndustryId
());
}
}
Map
<
Integer
,
String
>
categoriesNameMap
=
getCategoriesNameByIds
(
list
);
List
<
ServiceDTO
>
pageList
=
services
.
stream
()
.
map
(
d
->
{
ServiceDTO
serviceDTO
=
new
ServiceDTO
(
d
);
serviceDTO
.
setApplicationName
(
categoriesNameMap
.
get
(
d
.
getApplicationId
()));
serviceDTO
.
setIndustryName
(
categoriesNameMap
.
get
(
d
.
getIndustryId
()));
return
serviceDTO
;
})
.
collect
(
Collectors
.
toList
());
return
PageResult
.
buildPage
(
pageNo
,
param
.
getPageSize
(),
count
,
pageList
);
}
}
}
src/main/java/com/mmc/pms/service/Impl/CategoriesServiceImpl.java
浏览文件 @
a3df433c
...
@@ -3,10 +3,14 @@ package com.mmc.pms.service.Impl;
...
@@ -3,10 +3,14 @@ package com.mmc.pms.service.Impl;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.common.ResultEnum
;
import
com.mmc.pms.common.ResultEnum
;
import
com.mmc.pms.dao.CategoriesDao
;
import
com.mmc.pms.dao.CategoriesDao
;
import
com.mmc.pms.dao.DirectoryDao
;
import
com.mmc.pms.dao.GoodsInfoDao
;
import
com.mmc.pms.dao.GoodsInfoDao
;
import
com.mmc.pms.entity.Categories
;
import
com.mmc.pms.entity.Categories
;
import
com.mmc.pms.entity.Directory
;
import
com.mmc.pms.entity.Directory
DO
;
import
com.mmc.pms.entity.GoodsInfo
;
import
com.mmc.pms.entity.GoodsInfo
;
import
com.mmc.pms.model.categories.dto.AllCategoryDTO
;
import
com.mmc.pms.model.categories.dto.CategoriesDTO
;
import
com.mmc.pms.model.categories.dto.CategoriesInfoListDTO
;
import
com.mmc.pms.model.categories.dto.ClassifyInfoDTO
;
import
com.mmc.pms.model.categories.dto.ClassifyInfoDTO
;
import
com.mmc.pms.model.categories.vo.ClassifyInfoVO
;
import
com.mmc.pms.model.categories.vo.ClassifyInfoVO
;
import
com.mmc.pms.model.categories.vo.DirectoryInfoVO
;
import
com.mmc.pms.model.categories.vo.DirectoryInfoVO
;
...
@@ -21,10 +25,7 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -21,10 +25,7 @@ import org.springframework.transaction.annotation.Transactional;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -38,6 +39,8 @@ public class CategoriesServiceImpl implements CategoriesService {
...
@@ -38,6 +39,8 @@ public class CategoriesServiceImpl implements CategoriesService {
private
CategoriesDao
categoriesDao
;
private
CategoriesDao
categoriesDao
;
@Resource
@Resource
private
GoodsInfoDao
goodsInfoDao
;
private
GoodsInfoDao
goodsInfoDao
;
@Autowired
private
DirectoryDao
directoryDao
;
@Override
@Override
public
ResultBody
addOrEditDirectory
(
DirectoryInfoVO
param
)
{
public
ResultBody
addOrEditDirectory
(
DirectoryInfoVO
param
)
{
...
@@ -45,7 +48,7 @@ public class CategoriesServiceImpl implements CategoriesService {
...
@@ -45,7 +48,7 @@ public class CategoriesServiceImpl implements CategoriesService {
if
(
type
>
0
)
{
if
(
type
>
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
DIRECTORY_NAME_HAS_BEEN_EXIST
);
return
ResultBody
.
error
(
ResultEnum
.
DIRECTORY_NAME_HAS_BEEN_EXIST
);
}
}
Directory
directory
=
new
Directory
(
param
);
Directory
DO
directory
=
new
DirectoryDO
(
param
);
if
(
param
.
getId
()
==
null
)
{
if
(
param
.
getId
()
==
null
)
{
categoriesDao
.
insertDirectory
(
directory
);
categoriesDao
.
insertDirectory
(
directory
);
}
else
{
}
else
{
...
@@ -64,8 +67,8 @@ public class CategoriesServiceImpl implements CategoriesService {
...
@@ -64,8 +67,8 @@ public class CategoriesServiceImpl implements CategoriesService {
if
(
count
==
0
)
{
if
(
count
==
0
)
{
return
PageResult
.
buildPage
(
pageNo
,
pageSize
,
count
);
return
PageResult
.
buildPage
(
pageNo
,
pageSize
,
count
);
}
}
List
<
Directory
>
directoryList
=
categoriesDao
.
directoryList
((
pageNo
-
1
)
*
pageSize
,
pageSize
,
type
);
List
<
Directory
DO
>
directoryList
=
categoriesDao
.
directoryList
((
pageNo
-
1
)
*
pageSize
,
pageSize
,
type
);
List
<
DirectoryInfoVO
>
list
=
directoryList
.
stream
().
map
(
Directory:
:
buildDirectoryInfoVO
).
collect
(
Collectors
.
toList
());
List
<
DirectoryInfoVO
>
list
=
directoryList
.
stream
().
map
(
Directory
DO
:
:
buildDirectoryInfoVO
).
collect
(
Collectors
.
toList
());
return
PageResult
.
buildPage
(
pageNo
,
pageSize
,
count
,
list
);
return
PageResult
.
buildPage
(
pageNo
,
pageSize
,
count
,
list
);
}
}
...
@@ -193,11 +196,36 @@ public class CategoriesServiceImpl implements CategoriesService {
...
@@ -193,11 +196,36 @@ public class CategoriesServiceImpl implements CategoriesService {
@Override
@Override
public
ResultBody
getDirectoryList
(
Integer
type
)
{
public
ResultBody
getDirectoryList
(
Integer
type
)
{
List
<
Directory
>
directoryList
=
categoriesDao
.
getDirectoryList
(
type
);
List
<
Directory
DO
>
directoryList
=
categoriesDao
.
getDirectoryList
(
type
);
List
<
DirectoryInfoVO
>
list
=
directoryList
.
stream
().
map
(
Directory:
:
buildDirectoryInfoVO
).
collect
(
Collectors
.
toList
());
List
<
DirectoryInfoVO
>
list
=
directoryList
.
stream
().
map
(
Directory
DO
:
:
buildDirectoryInfoVO
).
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
list
);
return
ResultBody
.
success
(
list
);
}
}
@Override
public
List
<
Categories
>
getCategoriesListByDirectoryName
(
String
directoryName
)
{
DirectoryDO
directoryDO
=
directoryDao
.
getDirectoryByName
(
directoryName
);
List
<
Categories
>
categories
=
categoriesDao
.
getCategoriesByDirectoryId
(
directoryDO
.
getId
());
return
categories
;
}
@Override
public
ResultBody
getApplicationList
(
String
directoryName
)
{
List
<
Categories
>
categories
=
getCategoriesListByDirectoryName
(
directoryName
);
if
(
org
.
springframework
.
util
.
CollectionUtils
.
isEmpty
(
categories
))
{
return
ResultBody
.
success
();
}
List
<
CategoriesDTO
>
collect
=
categories
.
stream
().
map
(
CategoriesDTO:
:
new
).
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
collect
);
}
@Override
public
List
<
Categories
>
getCategoriesListByIds
(
Set
<
Integer
>
ids
)
{
if
(
CollectionUtils
.
isEmpty
(
ids
))
{
return
null
;
}
return
categoriesDao
.
getCategoriesListByIds
(
ids
);
}
@Override
@Override
public
ResultBody
deleteRelevantBusiness
(
Integer
id
)
{
public
ResultBody
deleteRelevantBusiness
(
Integer
id
)
{
...
@@ -205,7 +233,41 @@ public class CategoriesServiceImpl implements CategoriesService {
...
@@ -205,7 +233,41 @@ public class CategoriesServiceImpl implements CategoriesService {
return
ResultBody
.
success
();
return
ResultBody
.
success
();
}
}
@Override
public
ResultBody
queryCategoryInfoByType
(
Integer
type
)
{
List
<
DirectoryDO
>
categoryDirectoryList
=
getCategoryDirectoryList
(
type
);
if
(
CollectionUtils
.
isNotEmpty
(
categoryDirectoryList
))
{
List
<
AllCategoryDTO
>
allCategoryDTOList
=
categoryDirectoryList
.
stream
()
.
map
(
DirectoryDO:
:
buildAllCategoryDTO
)
.
collect
(
Collectors
.
toList
());
Map
<
Integer
,
List
<
CategoriesInfoListDTO
>>
categoryMap
=
getCategoryMap
(
allCategoryDTOList
);
addSubCategories
(
allCategoryDTOList
,
categoryMap
);
return
ResultBody
.
success
(
allCategoryDTOList
);
}
return
ResultBody
.
success
();
}
private
List
<
DirectoryDO
>
getCategoryDirectoryList
(
Integer
type
)
{
return
categoriesDao
.
getDirectoryList
(
type
);
}
private
Map
<
Integer
,
List
<
CategoriesInfoListDTO
>>
getCategoryMap
(
List
<
AllCategoryDTO
>
allCategoryDTOList
)
{
List
<
Integer
>
directoryIdIds
=
allCategoryDTOList
.
stream
()
.
map
(
AllCategoryDTO:
:
getDirectoryId
)
.
collect
(
Collectors
.
toList
());
List
<
Categories
>
categoriesList
=
categoriesDao
.
selectCategoryByDirectoryId
(
directoryIdIds
);
return
categoriesList
.
stream
()
.
map
(
Categories:
:
buildCategoriesInfoListDTO
)
.
collect
(
Collectors
.
groupingBy
(
CategoriesInfoListDTO:
:
getDirectoryId
));
}
private
void
addSubCategories
(
List
<
AllCategoryDTO
>
allCategoryDTOList
,
Map
<
Integer
,
List
<
CategoriesInfoListDTO
>>
categoryMap
)
{
for
(
AllCategoryDTO
allCategoryDTO
:
allCategoryDTOList
)
{
Optional
.
ofNullable
(
categoryMap
.
get
(
allCategoryDTO
.
getDirectoryId
()))
.
ifPresent
(
allCategoryDTO:
:
setCategoriesInfoListDTO
);
}
}
}
}
...
...
src/main/java/com/mmc/pms/service/Impl/GoodsInfoServiceImpl.java
浏览文件 @
a3df433c
...
@@ -551,22 +551,41 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
...
@@ -551,22 +551,41 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
private
List
<
GoodsSpecDTO
>
getProductSpecInfo
(
Integer
goodsInfoId
)
{
private
List
<
GoodsSpecDTO
>
getProductSpecInfo
(
Integer
goodsInfoId
)
{
// 获取商品对应绑定sku的信息
// 获取商品对应绑定sku的信息
List
<
MallProdInfoDO
>
mallProSkuInfo
=
goodsInfoDao
.
getMallProSkuInfo
(
goodsInfoId
);
List
<
MallProdInfoDO
>
mallProdSkuInfoList
=
goodsInfoDao
.
getMallProSkuInfo
(
goodsInfoId
);
// 获取该产品下的规格id
List
<
GoodsSpecDTO
>
list
=
mallProdSkuInfoList
.
stream
().
map
(
MallProdInfoDO:
:
buildGoodsSpecDTO
).
collect
(
Collectors
.
toList
());
Map
<
Integer
,
String
>
specIdsMap
=
mallProSkuInfo
.
stream
().
collect
(
Collectors
.
toMap
(
MallProdInfoDO:
:
getId
,
MallProdInfoDO:
:
getProductSpecIdList
));
// 获取规格来源详细信息
List
<
GoodsSpecDTO
>
list
=
mallProSkuInfo
.
stream
().
map
(
MallProdInfoDO:
:
buildGoodsSpecDTO
).
collect
(
Collectors
.
toList
());
List
<
MallProdSkuInfoSpecDO
>
mallProdSkuInfoSpec
=
goodsInfoDao
.
getMallProSkuInfoSpec
(
goodsInfoId
);
for
(
GoodsSpecDTO
goodsSpecDTO
:
list
)
{
// 根据id查询出规格的具体信息
String
specIds
=
specIdsMap
.
get
(
goodsSpecDTO
.
getId
());
list
=
list
.
stream
().
peek
(
d
->
{
String
[]
ids
=
specIds
.
split
(
","
);
List
<
MallProductSpecDTO
>
specList
=
new
ArrayList
<>();
List
<
Integer
>
idList
=
new
ArrayList
<>();
for
(
MallProdSkuInfoSpecDO
e
:
mallProdSkuInfoSpec
)
{
for
(
String
id
:
ids
)
{
if
(
d
.
getId
().
equals
(
e
.
getMallProdSkuInfoId
()))
{
idList
.
add
(
Integer
.
parseInt
(
id
));
// 构建规格对象
ProductSpecDO
productSpecDO
=
e
.
getProductSpecDO
();
MallProductSpecDTO
productSpecDTO
=
productSpecDO
.
buildMallProductSpecDTO
();
productSpecDTO
.
setProductSkuId
(
d
.
getSkuId
());
productSpecDTO
.
setId
(
e
.
getId
());
productSpecDTO
.
setProductSpec
(
e
.
getProductSpecId
());
if
(
d
.
getFlag
().
equals
(
1
))
{
// 获取自定义sku下规格的价格配置信息
ProductSpecCPQVO
productSpecCPQVO
=
new
ProductSpecCPQVO
();
productSpecCPQVO
.
setProductSpecId
(
e
.
getProductSpecId
());
List
<
ProductSpecPriceDO
>
productSpecPrice
=
productDao
.
getProductSpecPrice
(
productSpecCPQVO
);
List
<
SpecPriceVO
>
collect
=
productSpecPrice
.
stream
().
map
(
m
->
{
SpecPriceVO
specPriceVO
=
new
SpecPriceVO
();
specPriceVO
.
setId
(
m
.
getId
());
specPriceVO
.
setPrice
(
m
.
getPrice
());
specPriceVO
.
setCooperationTag
(
m
.
getCooperationTag
());
return
specPriceVO
;
}).
collect
(
Collectors
.
toList
());
productSpecCPQVO
.
setSpecPrice
(
collect
);
productSpecDTO
.
setProductSpecCPQVO
(
productSpecCPQVO
);
}
specList
.
add
(
productSpecDTO
);
}
}
}
// 根据specIds集合找出spec的信息
d
.
setProductSpecList
(
specList
);
List
<
ProductSpecDO
>
productSpecDOS
=
productDao
.
listProductSpecInfo
(
idList
);
}).
collect
(
Collectors
.
toList
());
List
<
MallProductSpecDTO
>
mallProductSpecList
=
productSpecDOS
.
stream
().
map
(
ProductSpecDO:
:
buildMallProductSpecDTO
).
collect
(
Collectors
.
toList
());
goodsSpecDTO
.
setProductSpecList
(
mallProductSpecList
);
}
return
list
;
return
list
;
}
}
...
@@ -595,6 +614,7 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
...
@@ -595,6 +614,7 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
/**
/**
* 根据商品id,商品规格id查询并填充相关信息
* 根据商品id,商品规格id查询并填充相关信息
*
* @param param
* @param param
* @return
* @return
*/
*/
...
...
src/main/java/com/mmc/pms/service/Impl/ProductServiceImpl.java
浏览文件 @
a3df433c
...
@@ -184,12 +184,12 @@ public class ProductServiceImpl implements ProductSkuService {
...
@@ -184,12 +184,12 @@ public class ProductServiceImpl implements ProductSkuService {
@NotNull
@NotNull
public
ResultBody
insertSpecPrice
(
ProductSpecCPQVO
productSpecCPQVO
)
{
public
ResultBody
insertSpecPrice
(
ProductSpecCPQVO
productSpecCPQVO
)
{
List
<
ProductSpecPriceDO
>
list
=
getProductSpecPriceDOS
(
productSpecCPQVO
);
List
<
ProductSpecPriceDO
>
list
=
getProductSpecPriceDOS
(
productSpecCPQVO
);
if
(
productSpecCPQVO
.
getType
().
equals
(
1
)
&&
productSpecCPQVO
.
getLeaseTerm
()
==
null
)
{
return
ResultBody
.
error
(
"租赁期限不能为空!"
);
}
// 批量插入规格销售价格
// 批量插入规格销售价格
if
(
productSpecCPQVO
.
getType
().
equals
(
0
))
{
if
(
productSpecCPQVO
.
getType
().
equals
(
0
))
{
int
status
=
productDao
.
batchInsertSpecPrice
(
list
);
productDao
.
batchInsertSpecPrice
(
list
);
if
(
status
<=
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
FAILED_TO_ADD_DATA
);
}
}
else
{
}
else
{
// 批量插入租赁价格
// 批量插入租赁价格
productDao
.
batchInsertLeaseSpecPrice
(
list
);
productDao
.
batchInsertLeaseSpecPrice
(
list
);
...
...
src/main/java/com/mmc/pms/service/Impl/WebDeviceServiceImpl.java
浏览文件 @
a3df433c
package
com
.
mmc
.
pms
.
service
.
Impl
;
package
com
.
mmc
.
pms
.
service
.
Impl
;
import
com.mmc.pms.auth.dto.UserAccountSimpleDTO
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.constant.TokenConstant
;
import
com.mmc.pms.dao.GoodsInfoDao
;
import
com.mmc.pms.dao.ProductDao
;
import
com.mmc.pms.dao.WebDeviceDao
;
import
com.mmc.pms.dao.WebDeviceDao
;
import
com.mmc.pms.entity.*
;
import
com.mmc.pms.entity.*
;
import
com.mmc.pms.feign.UserAppApi
;
import
com.mmc.pms.model.lease.dto.*
;
import
com.mmc.pms.model.lease.dto.*
;
import
com.mmc.pms.model.lease.vo.LeaseVo
;
import
com.mmc.pms.model.lease.vo.LeaseVo
;
import
com.mmc.pms.model.other.dto.AdDTO
;
import
com.mmc.pms.model.other.dto.AdDTO
;
...
@@ -15,7 +20,9 @@ import com.mmc.pms.service.WebDeviceService;
...
@@ -15,7 +20,9 @@ import com.mmc.pms.service.WebDeviceService;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -27,16 +34,20 @@ public class WebDeviceServiceImpl implements WebDeviceService {
...
@@ -27,16 +34,20 @@ public class WebDeviceServiceImpl implements WebDeviceService {
@Autowired
@Autowired
WebDeviceDao
webDeviceDao
;
WebDeviceDao
webDeviceDao
;
@Autowired
UserAppApi
userAppApi
;
@Autowired
ProductDao
productDao
;
@Autowired
GoodsInfoDao
goodsInfoDao
;
@Override
@Override
public
ResultBody
listSecondDistrict
()
{
public
ResultBody
listSecondDistrict
()
{
List
<
DistrictDO
>
list
=
webDeviceDao
.
listSecondDistrict
();
List
<
DistrictDO
>
list
=
webDeviceDao
.
listSecondDistrict
();
List
<
DistrictInfoDTO
>
dtoList
=
List
<
DistrictInfoDTO
>
dtoList
=
list
.
stream
()
list
.
stream
().
map
(
DistrictDO:
:
builderDistrictInfoDTO
).
collect
(
Collectors
.
toList
());
.
map
(
d
->
{
return
d
.
builderDistrictInfoDTO
();
})
.
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
dtoList
);
return
ResultBody
.
success
(
dtoList
);
}
}
...
@@ -144,22 +155,28 @@ public class WebDeviceServiceImpl implements WebDeviceService {
...
@@ -144,22 +155,28 @@ public class WebDeviceServiceImpl implements WebDeviceService {
}
}
@Override
@Override
public
ResultBody
listWareInfoPage
(
WareInfoQO
param
)
{
public
ResultBody
listWareInfoPage
(
WareInfoQO
param
,
HttpServletRequest
request
,
Integer
userAccountId
)
{
int
count
=
webDeviceDao
.
countListWareInfoPage
(
param
);
UserAccountSimpleDTO
userAccountSimpleDTO
=
userAppApi
.
feignGetUserSimpleInfo
(
userAccountId
,
request
.
getHeader
(
TokenConstant
.
TOKEN
));
List
<
Integer
>
userIds
=
userAppApi
.
feignListUserAccountIds
(
param
.
getProvinceId
(),
null
,
null
,
request
.
getHeader
(
TokenConstant
.
TOKEN
));
int
count
=
webDeviceDao
.
countListWareInfoPage
(
param
.
getCategoryId
(),
userIds
);
if
(
count
==
0
)
{
if
(
count
==
0
)
{
return
ResultBody
.
success
(
return
ResultBody
.
success
(
PageResult
.
buildPage
(
param
.
getPageNo
(),
param
.
getPageSize
(),
count
));
PageResult
.
buildPage
(
param
.
getPageNo
(),
param
.
getPageSize
(),
count
));
}
}
int
pageNo
=
param
.
getPageNo
();
int
pageNo
=
param
.
getPageNo
();
param
.
buildCurrentPage
();
param
.
buildCurrentPage
();
List
<
WareInfoDO
>
list
=
webDeviceDao
.
listWareInfoPage
(
param
);
List
<
GoodsInfo
>
list
=
webDeviceDao
.
listWareInfoPage
(
param
.
getCategoryId
(),
userIds
,
param
.
getPageNo
(),
param
.
getPageSize
());
List
<
WareInfoItemDTO
>
pageList
=
List
<
LeaseGoodsInfoDTO
>
pageList
=
list
.
stream
().
map
(
GoodsInfo:
:
buildLeaseGoodsInfoDTO
).
collect
(
Collectors
.
toList
());
list
.
stream
()
if
(
userAccountSimpleDTO
.
getCooperationTagId
()
==
null
)
{
.
map
(
return
ResultBody
.
success
(
PageResult
.
buildPage
(
pageNo
,
param
.
getPageSize
(),
count
,
pageList
));
d
->
{
}
return
d
.
buildWareInfoItemDTO
();
List
<
Integer
>
goodsId
=
pageList
.
stream
().
map
(
LeaseGoodsInfoDTO:
:
getId
).
collect
(
Collectors
.
toList
());
})
List
<
MallProdSkuInfoSpecDO
>
mallProSkuInfoSpec
=
goodsInfoDao
.
listMallprodSpecById
(
goodsId
);
.
collect
(
Collectors
.
toList
());
Map
<
Integer
,
MallProdSkuInfoSpecDO
>
specMap
=
mallProSkuInfoSpec
.
stream
().
collect
(
Collectors
.
toMap
(
MallProdSkuInfoSpecDO:
:
getGoodsInfoId
,
d
->
d
,
(
k1
,
k2
)
->
k1
));
pageList
.
stream
().
peek
(
d
->
{
MallProdSkuInfoSpecDO
mallProdSkuInfoSpecDO
=
specMap
.
get
(
d
.
getId
());
d
.
setPrice
(
mallProdSkuInfoSpecDO
.
getPrice
());
}).
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
PageResult
.
buildPage
(
pageNo
,
param
.
getPageSize
(),
count
,
pageList
));
return
ResultBody
.
success
(
PageResult
.
buildPage
(
pageNo
,
param
.
getPageSize
(),
count
,
pageList
));
}
}
...
...
src/main/java/com/mmc/pms/service/WebDeviceService.java
浏览文件 @
a3df433c
...
@@ -7,6 +7,7 @@ import com.mmc.pms.model.other.dto.AdDTO;
...
@@ -7,6 +7,7 @@ import com.mmc.pms.model.other.dto.AdDTO;
import
com.mmc.pms.model.qo.WareInfoQO
;
import
com.mmc.pms.model.qo.WareInfoQO
;
import
com.mmc.pms.model.sale.dto.SkuInfoDTO
;
import
com.mmc.pms.model.sale.dto.SkuInfoDTO
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -31,7 +32,7 @@ public interface WebDeviceService {
...
@@ -31,7 +32,7 @@ public interface WebDeviceService {
ResultBody
detail
(
Integer
id
);
ResultBody
detail
(
Integer
id
);
ResultBody
listWareInfoPage
(
WareInfoQO
param
);
ResultBody
listWareInfoPage
(
WareInfoQO
param
,
HttpServletRequest
request
,
Integer
userAccountId
);
WareInfoDTO
getWareInfoById
(
Integer
id
);
WareInfoDTO
getWareInfoById
(
Integer
id
);
...
...
src/main/java/com/mmc/pms/util/BizException.java
浏览文件 @
a3df433c
...
@@ -3,7 +3,6 @@ package com.mmc.pms.util;
...
@@ -3,7 +3,6 @@ package com.mmc.pms.util;
import
com.mmc.pms.common.BaseErrorInfoInterface
;
import
com.mmc.pms.common.BaseErrorInfoInterface
;
import
com.mmc.pms.common.ResultEnum
;
import
com.mmc.pms.common.ResultEnum
;
/**
/**
* @author 作者 geDuo
* @author 作者 geDuo
* @version 创建时间:2021年8月13日 上午9:25:43
* @version 创建时间:2021年8月13日 上午9:25:43
...
@@ -11,80 +10,76 @@ import com.mmc.pms.common.ResultEnum;
...
@@ -11,80 +10,76 @@ import com.mmc.pms.common.ResultEnum;
*/
*/
public
class
BizException
extends
RuntimeException
{
public
class
BizException
extends
RuntimeException
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/**
/** 错误码 */
* 错误码
protected
String
errorCode
;
*/
/** 错误信息 */
protected
String
errorCode
;
protected
String
errorMsg
;
/**
* 错误信息
public
BizException
()
{
*/
super
();
protected
String
errorMsg
;
}
public
BizException
()
{
public
BizException
(
BaseErrorInfoInterface
errorInfoInterface
)
{
super
();
super
(
errorInfoInterface
.
getResultCode
());
}
this
.
errorCode
=
errorInfoInterface
.
getResultCode
();
this
.
errorMsg
=
errorInfoInterface
.
getResultMsg
();
public
BizException
(
BaseErrorInfoInterface
errorInfoInterface
)
{
}
super
(
errorInfoInterface
.
getResultCode
());
this
.
errorCode
=
errorInfoInterface
.
getResultCode
();
public
BizException
(
BaseErrorInfoInterface
errorInfoInterface
,
Throwable
cause
)
{
this
.
errorMsg
=
errorInfoInterface
.
getResultMsg
();
super
(
errorInfoInterface
.
getResultCode
(),
cause
);
}
this
.
errorCode
=
errorInfoInterface
.
getResultCode
();
this
.
errorMsg
=
errorInfoInterface
.
getResultMsg
();
public
BizException
(
BaseErrorInfoInterface
errorInfoInterface
,
Throwable
cause
)
{
}
super
(
errorInfoInterface
.
getResultCode
(),
cause
);
this
.
errorCode
=
errorInfoInterface
.
getResultCode
();
public
BizException
(
ResultEnum
enums
)
{
this
.
errorMsg
=
errorInfoInterface
.
getResultMsg
();
super
(
enums
.
getResultCode
());
}
this
.
errorCode
=
enums
.
getResultCode
();
this
.
errorMsg
=
enums
.
getResultMsg
();
public
BizException
(
ResultEnum
enums
)
{
}
super
(
enums
.
getResultCode
());
this
.
errorCode
=
enums
.
getResultCode
();
public
BizException
(
String
errorMsg
)
{
this
.
errorMsg
=
enums
.
getResultMsg
();
super
(
errorMsg
);
}
this
.
errorCode
=
"-1"
;
this
.
errorMsg
=
errorMsg
;
public
BizException
(
String
errorMsg
)
{
}
super
(
errorMsg
);
this
.
errorCode
=
"-1"
;
public
BizException
(
String
errorCode
,
String
errorMsg
)
{
this
.
errorMsg
=
errorMsg
;
super
(
errorCode
);
}
this
.
errorCode
=
errorCode
;
this
.
errorMsg
=
errorMsg
;
public
BizException
(
String
errorCode
,
String
errorMsg
)
{
}
super
(
errorCode
);
this
.
errorCode
=
errorCode
;
public
BizException
(
String
errorCode
,
String
errorMsg
,
Throwable
cause
)
{
this
.
errorMsg
=
errorMsg
;
super
(
errorCode
,
cause
);
}
this
.
errorCode
=
errorCode
;
this
.
errorMsg
=
errorMsg
;
public
BizException
(
String
errorCode
,
String
errorMsg
,
Throwable
cause
)
{
}
super
(
errorCode
,
cause
);
this
.
errorCode
=
errorCode
;
public
String
getErrorCode
()
{
this
.
errorMsg
=
errorMsg
;
return
errorCode
;
}
}
public
String
getErrorCode
()
{
public
void
setErrorCode
(
String
errorCode
)
{
return
errorCode
;
this
.
errorCode
=
errorCode
;
}
}
public
void
setErrorCode
(
String
errorCode
)
{
public
String
getErrorMsg
()
{
this
.
errorCode
=
errorCode
;
return
errorMsg
;
}
}
public
String
getErrorMsg
()
{
public
void
setErrorMsg
(
String
errorMsg
)
{
return
errorMsg
;
this
.
errorMsg
=
errorMsg
;
}
}
public
void
setErrorMsg
(
String
errorMsg
)
{
@Override
this
.
errorMsg
=
errorMsg
;
public
String
getMessage
()
{
}
return
errorMsg
;
}
@Override
public
String
getMessage
()
{
@Override
return
errorMsg
;
public
Throwable
fillInStackTrace
()
{
}
return
this
;
}
@Override
public
Throwable
fillInStackTrace
()
{
return
this
;
}
}
}
src/main/java/com/mmc/pms/util/PathUtil.java
浏览文件 @
a3df433c
...
@@ -8,9 +8,9 @@ import org.springframework.util.AntPathMatcher;
...
@@ -8,9 +8,9 @@ import org.springframework.util.AntPathMatcher;
* @explain 解析地址类
* @explain 解析地址类
*/
*/
public
class
PathUtil
{
public
class
PathUtil
{
private
static
AntPathMatcher
matcher
=
new
AntPathMatcher
();
private
static
AntPathMatcher
matcher
=
new
AntPathMatcher
();
public
static
boolean
isPathMatch
(
String
pattern
,
String
path
)
{
public
static
boolean
isPathMatch
(
String
pattern
,
String
path
)
{
return
matcher
.
match
(
pattern
,
path
);
return
matcher
.
match
(
pattern
,
path
);
}
}
}
}
src/main/resources/application-dev.yml
浏览文件 @
a3df433c
...
@@ -6,7 +6,7 @@ spring:
...
@@ -6,7 +6,7 @@ spring:
username
:
tmj
username
:
tmj
password
:
MMC@2022&MYSQL
password
:
MMC@2022&MYSQL
redis
:
redis
:
database
:
3
database
:
1
host
:
redis.default
host
:
redis.default
port
:
6379
port
:
6379
password
:
MMC@2022&REDIS
password
:
MMC@2022&REDIS
...
@@ -37,4 +37,8 @@ mmcflying:
...
@@ -37,4 +37,8 @@ mmcflying:
mount
:
mount
:
directory
:
D:@javaVolume@
directory
:
D:@javaVolume@
iuav
:
userapp
:
url
:
http://cms-svc:35150
src/main/resources/application-local.yml
浏览文件 @
a3df433c
...
@@ -54,4 +54,8 @@ mmcflying:
...
@@ -54,4 +54,8 @@ mmcflying:
mount
:
mount
:
directory
:
D:@javaVolume@
directory
:
D:@javaVolume@
iuav
:
userapp
:
url
:
http://127.0.0.1:35150
src/main/resources/application-prod.yml
浏览文件 @
a3df433c
...
@@ -6,7 +6,7 @@ spring:
...
@@ -6,7 +6,7 @@ spring:
username
:
tmj
username
:
tmj
password
:
MMC@2022&MYSQL
password
:
MMC@2022&MYSQL
redis
:
redis
:
database
:
3
database
:
1
host
:
redis.default
host
:
redis.default
port
:
6379
port
:
6379
password
:
MMC@2022&REDIS
password
:
MMC@2022&REDIS
...
@@ -36,3 +36,7 @@ mmcflying:
...
@@ -36,3 +36,7 @@ mmcflying:
path
:
/ossservlet/upload/download/
path
:
/ossservlet/upload/download/
mount
:
mount
:
directory
:
D:@javaVolume@
directory
:
D:@javaVolume@
iuav
:
userapp
:
url
:
http://cms-svc:35150
src/main/resources/mapper/CategoriesDao.xml
浏览文件 @
a3df433c
...
@@ -84,7 +84,7 @@
...
@@ -84,7 +84,7 @@
from directory
from directory
where is_deleted = 0
where is_deleted = 0
</select>
</select>
<select
id=
"directoryList"
resultType=
"com.mmc.pms.entity.Directory"
>
<select
id=
"directoryList"
resultType=
"com.mmc.pms.entity.Directory
DO
"
>
SELECT d.id,
SELECT d.id,
d.directory_name,
d.directory_name,
d.pid,
d.pid,
...
@@ -168,7 +168,7 @@
...
@@ -168,7 +168,7 @@
where id = #{id}
where id = #{id}
and is_default = 0
and is_default = 0
</select>
</select>
<select
id=
"getDirectoryList"
resultType=
"com.mmc.pms.entity.Directory"
>
<select
id=
"getDirectoryList"
resultType=
"com.mmc.pms.entity.Directory
DO
"
>
SELECT d.id,
SELECT d.id,
d.directory_name,
d.directory_name,
d.pid,
d.pid,
...
@@ -181,6 +181,30 @@
...
@@ -181,6 +181,30 @@
AND d.pid IS NULL
AND d.pid IS NULL
ORDER BY create_time DESC
ORDER BY create_time DESC
</select>
</select>
<select
id=
"selectCategoryByDirectoryId"
resultType=
"com.mmc.pms.entity.Categories"
>
select id, `name`, icon,directory_id
from categories
<where>
is_deleted = 0
<foreach
collection=
"list"
separator=
","
open=
"and directory_id in("
close=
")"
index=
"index"
item=
"d"
>
#{d}
</foreach>
</where>
</select>
<select
id=
"getCategoriesByDirectoryId"
resultType=
"com.mmc.pms.entity.Categories"
parameterType=
"java.lang.Integer"
>
SELECT id,`name` from categories where directory_id = #{directoryId} and is_deleted = 0 order by create_time desc
</select>
<select
id=
"getCategoriesListByIds"
resultType=
"com.mmc.pms.entity.Categories"
>
SELECT id,`name` from categories
where
<foreach
collection=
"ids"
open=
"id in("
close=
")"
separator=
","
item=
"item"
>
#{item}
</foreach>
and is_deleted = 0
</select>
<update
id=
"deleteById"
>
<update
id=
"deleteById"
>
UPDATE `categories`
UPDATE `categories`
SET `is_deleted` = 1
SET `is_deleted` = 1
...
...
src/main/resources/mapper/DirectoryDao.xml
0 → 100644
浏览文件 @
a3df433c
<?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.mmc.pms.dao.DirectoryDao"
>
<select
id=
"getDirectoryByName"
resultType=
"com.mmc.pms.entity.DirectoryDO"
>
select id,
directory_name,
pid,
`type`
from `directory`
where directory_name = #{directoryName}
</select>
</mapper>
\ No newline at end of file
src/main/resources/mapper/GoodsInfoDao.xml
浏览文件 @
a3df433c
...
@@ -440,4 +440,35 @@
...
@@ -440,4 +440,35 @@
AND im.img_type = 0
AND im.img_type = 0
WHERE gi.category_by_one = #{id}
WHERE gi.category_by_one = #{id}
</select>
</select>
<select
id=
"getMallProSkuInfoSpec"
resultType=
"com.mmc.pms.entity.MallProdSkuInfoSpecDO"
>
SELECT mp.id,
mp.mall_prod_info_id,
mp.product_spec_id,
ps.part_no,
ps.spec_image,
ps.spec_name,
ps.version_desc
FROM mall_prod_info_spec mp
INNER JOIN product_spec ps ON mp.product_spec_id = ps.id
WHERE mp.goods_info_id = #{id}
AND mp.is_deleted = 0
</select>
<select
id=
"listMallprodSpecById"
resultType=
"com.mmc.pms.entity.MallProdSkuInfoSpecDO"
>
SELECT
mp.id,
mp.goods_info_id,
mp.product_spec_id,
psp.price price
FROM
mall_prod_info_spec mp
LEFT JOIN product_spec_price psp ON mp.product_spec_id = psp.product_spec_id
AND psp.cooperation_tag = 0
AND psp.type = 0
<where>
mp.is_deleted = 0
<foreach
collection=
"list"
separator=
","
open=
" and mp.goods_info_id in ("
close=
")"
index=
"index"
item=
"d"
>
#{d}
</foreach>
</where>
</select>
</mapper>
</mapper>
src/main/resources/mapper/ProductDao.xml
浏览文件 @
a3df433c
...
@@ -71,7 +71,7 @@
...
@@ -71,7 +71,7 @@
<delete
id=
"removeProductSpecCPQ"
>
<delete
id=
"removeProductSpecCPQ"
>
DELETE
DELETE
FROM product_spec_price
FROM product_spec_price
WHERE product_spec_id = #{
i
d}
WHERE product_spec_id = #{
productSpecI
d}
and `type` = #{type}
and `type` = #{type}
</delete>
</delete>
...
...
src/main/resources/mapper/WebDeviceDao.xml
浏览文件 @
a3df433c
...
@@ -152,51 +152,51 @@
...
@@ -152,51 +152,51 @@
order by wi.create_time DESC
order by wi.create_time DESC
</select>
</select>
<select
id=
"countListWareInfoPage"
parameterType=
"com.mmc.pms.model.qo.WareInfoQO"
resultType=
"int"
>
<select
id=
"countListWareInfoPage"
parameterType=
"com.mmc.pms.entity.GoodsInfo"
resultType=
"int"
>
select count(*)
SELECT
from ware_info wi INNER JOIN ware_img img ON wi.id=img.ware_info_id LEFT JOIN ware_prop wp on
count(*)
wi.id=wp.ware_info_id
FROM
where wi.is_deleted = 0 and img.img_type = 0
goods_info gi
<if
test=
"districtId != null "
>
INNER JOIN goods_img img ON gi.id = img.goods_info_id
and wi.district_id = #{districtId}
<where>
</if>
gi.is_deleted = 0 and gi.shelf_status = 0
<if
test=
"categoryId != null "
>
<if
test=
"categoryIds != null"
>
and wi.ware_type_id = #{categoryId}
<foreach
collection=
"categoryIds"
item=
"item"
index=
"index"
open=
"and gi.category_by_one IN ("
close=
")"
</if>
separator=
","
>
<if
test=
"brandId != null "
>
#{item}
and wi.brand_id = #{brandId}
</foreach>
</if>
</if>
<if
test=
"modelId != null and modelId != '' "
>
<if
test=
"userIds != null"
>
and wi.model_id = #{modelId}
<foreach
collection=
"userIds"
item=
"user"
index=
"index"
open=
"and gi.add_goods_user_id IN ("
close=
")"
</if>
separator=
","
>
#{user}
</foreach>
</if>
</where>
</select>
</select>
<select
id=
"listWareInfoPage"
parameterType=
"com.mmc.pms.model.qo.WareInfoQO"
resultMap=
"wareInfoResultMap"
>
<select
id=
"listWareInfoPage"
resultType=
"com.mmc.pms.entity.GoodsInfo"
>
select
SELECT
wi.id,wi.ware_no,wi.ware_type_id,wi.ware_title,wi.ware_status,wi.pay_status,wi.min_deposit,wi.max_deposit,wi.min_rent,
gi.id,gi.goods_name,img.img_url mainImg
wi.max_rent,wi.total_stock,wi.total_sale,wi.sku_num,wi.tags,wi.district_id,
FROM
wi.brand_id,
goods_info gi
wi.model_id,wi.create_time,wi.update_time,img.id as
INNER JOIN goods_img img ON gi.id = img.goods_info_id and img.img_type = 0
ware_img_id,img.ware_info_id,img.img_url,img.img_type,wp.prop_info_id
<where>
from ware_info wi INNER JOIN ware_img img ON wi.id=img.ware_info_id LEFT JOIN ware_prop wp on
gi.is_deleted = 0 and gi.shelf_status = 0
wi.id=wp.ware_info_id
<if
test=
"categoryIds != null"
>
where wi.is_deleted = 0 and img.img_type = 0
<foreach
collection=
"categoryIds"
item=
"item"
index=
"index"
open=
"and gi.category_by_one IN ("
close=
")"
<if
test=
"id != null "
>
separator=
","
>
and wi.id = #{id}
#{item}
</if>
</foreach>
<if
test=
"districtId != null "
>
</if>
and wi.district_id = #{districtId}
<if
test=
"userIds != null"
>
</if>
<foreach
collection=
"userIds"
item=
"user"
index=
"index"
open=
"and gi.add_goods_user_id IN ("
close=
")"
<if
test=
"categoryId != null "
>
separator=
","
>
and wi.ware_type_id = #{categoryId}
#{user}
</if>
</foreach>
<if
test=
"brandId != null "
>
</if>
and wi.brand_id = #{brandId}
</where>
</if>
order by gi.create_time DESC
<if
test=
"modelId != null and modelId != '' "
>
and wi.model_id = #{modelId}
</if>
order by wi.create_time DESC
limit #{pageNo},#{pageSize}
limit #{pageNo},#{pageSize}
</select>
</select>
<select
id=
"getWareInfoById"
resultMap=
"wareInfoResultMap"
parameterType=
"java.lang.Integer"
>
<select
id=
"getWareInfoById"
resultMap=
"wareInfoResultMap"
parameterType=
"java.lang.Integer"
>
...
@@ -243,37 +243,48 @@
...
@@ -243,37 +243,48 @@
where ware_info_id = #{wareInfoId}
where ware_info_id = #{wareInfoId}
</select>
</select>
<select
id=
"ad"
resultType=
"com.mmc.pms.entity.AdDO"
>
<select
id=
"ad"
resultType=
"com.mmc.pms.entity.AdDO"
>
SELECT
SELECT id,
id,
image_url AS imageUrl
image_url AS imageUrl
FROM device_ad
FROM
device_ad
</select>
</select>
<resultMap
type=
"com.mmc.pms.entity.SkuInfoDO"
<resultMap
type=
"com.mmc.pms.entity.SkuInfoDO"
id=
"skuInfoDoResultMap"
>
id=
"skuInfoDoResultMap"
>
<id
property=
"id"
column=
"sku_info_id"
/>
<id
property=
"id"
column=
"sku_info_id"
/>
<result
property=
"wareInfoId"
column=
"ware_info_id"
/>
<result
property=
"wareInfoId"
column=
"ware_info_id"
/>
<result
property=
"skuTitle"
column=
"sku_title"
/>
<result
property=
"skuTitle"
column=
"sku_title"
/>
<result
property=
"rentDeposit"
column=
"rent_deposit"
/>
<result
property=
"rentDeposit"
column=
"rent_deposit"
/>
<result
property=
"stockNum"
column=
"stock_num"
/>
<result
property=
"stockNum"
column=
"stock_num"
/>
<result
property=
"saleNum"
column=
"sale_num"
/>
<result
property=
"saleNum"
column=
"sale_num"
/>
<result
property=
"rentDeposit"
column=
"rent_deposit"
/>
<result
property=
"rentDeposit"
column=
"rent_deposit"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<collection
property=
"skuPriceDOList"
javaType=
"java.util.List"
<collection
property=
"skuPriceDOList"
javaType=
"java.util.List"
ofType=
"com.mmc.pms.entity.SkuPriceDO"
>
ofType=
"com.mmc.pms.entity.SkuPriceDO"
>
<id
property=
"id"
column=
"sku_price_id"
/>
<id
property=
"id"
column=
"sku_price_id"
/>
<result
property=
"wareInfoId"
column=
"ware_info_id"
/>
<result
property=
"wareInfoId"
column=
"ware_info_id"
/>
<result
property=
"skuInfoId"
column=
"sku_info_id"
/>
<result
property=
"skuInfoId"
column=
"sku_info_id"
/>
<result
property=
"rentPrice"
column=
"rent_price"
/>
<result
property=
"rentPrice"
column=
"rent_price"
/>
<result
property=
"minDay"
column=
"min_day"
/>
<result
property=
"minDay"
column=
"min_day"
/>
<result
property=
"maxDay"
column=
"max_day"
/>
<result
property=
"maxDay"
column=
"max_day"
/>
</collection>
</collection>
</resultMap>
</resultMap>
<select
id=
"listSkuInfo"
resultMap=
"skuInfoDoResultMap"
parameterType=
"java.lang.Integer"
>
<select
id=
"listSkuInfo"
resultMap=
"skuInfoDoResultMap"
parameterType=
"java.lang.Integer"
>
select si.id as sku_info_id,si.ware_info_id,si.sku_title,si.rent_deposit,si.stock_num,si.sale_num,
select si.id as sku_info_id,
si.create_time,si.update_time,sp.id as sku_price_id,sp.rent_price,sp.min_day,sp.max_day
si.ware_info_id,
from sku_info si INNER JOIN sku_price sp ON si.id=sp.sku_info_id where si.ware_info_id = #{id} and si.is_deleted = 0
si.sku_title,
si.rent_deposit,
si.stock_num,
si.sale_num,
si.create_time,
si.update_time,
sp.id as sku_price_id,
sp.rent_price,
sp.min_day,
sp.max_day
from sku_info si
INNER JOIN sku_price sp ON si.id = sp.sku_info_id
where si.ware_info_id = #{id}
and si.is_deleted = 0
</select>
</select>
</mapper>
</mapper>
src/main/resources/mapper/work/BackstageTaskServiceDao.xml
浏览文件 @
a3df433c
...
@@ -65,7 +65,7 @@
...
@@ -65,7 +65,7 @@
from service
from service
<where>
<where>
<if
test=
"serviceName != null and serviceName != ''"
>
<if
test=
"serviceName != null and serviceName != ''"
>
and service_name
= #{serviceName}
and service_name
LIKE CONCAT('%',#{serviceName},'%')
</if>
</if>
<if
test=
"applicationId != null"
>
<if
test=
"applicationId != null"
>
and application_id = #{applicationId}
and application_id = #{applicationId}
...
@@ -84,15 +84,12 @@
...
@@ -84,15 +84,12 @@
</select>
</select>
<!--统计总行数-->
<!--统计总行数-->
<select
id=
"count"
resultType=
"java.lang.Long
"
>
<select
id=
"count"
parameterType=
"com.mmc.pms.model.qo.ServiceQO"
resultType=
"java.lang.Integer
"
>
select count(
1
)
select count(
*
)
from service
from service
<where>
<where>
<if
test=
"id != null"
>
and id = #{id}
</if>
<if
test=
"serviceName != null and serviceName != ''"
>
<if
test=
"serviceName != null and serviceName != ''"
>
and service_name
= #{serviceName}
and service_name
LIKE CONCAT('%',#{serviceName},'%')
</if>
</if>
<if
test=
"applicationId != null"
>
<if
test=
"applicationId != null"
>
and application_id = #{applicationId}
and application_id = #{applicationId}
...
@@ -100,33 +97,11 @@
...
@@ -100,33 +97,11 @@
<if
test=
"industryId != null"
>
<if
test=
"industryId != null"
>
and industry_id = #{industryId}
and industry_id = #{industryId}
</if>
</if>
<if
test=
"displayState != null"
>
and display_state = #{displayState}
</if>
<if
test=
"coverPlan != null and coverPlan != ''"
>
and cover_plan = #{coverPlan}
</if>
<if
test=
"shareCard != null and shareCard != ''"
>
and share_card = #{shareCard}
</if>
<if
test=
"video != null and video != ''"
>
and video = #{video}
</if>
<if
test=
"serviceIntroduction != null and serviceIntroduction != ''"
>
and service_introduction = #{serviceIntroduction}
</if>
<if
test=
"createTime != null"
>
and create_time = #{createTime}
</if>
<if
test=
"updateTime != null"
>
and update_time = #{updateTime}
</if>
<if
test=
"isDeleted != null"
>
and is_deleted = #{isDeleted}
</if>
<if
test=
"accountId != null"
>
<if
test=
"accountId != null"
>
and account_id = #{accountId}
and account_id = #{accountId}
</if>
</if>
and is_deleted = 0
and display_state = 0
</where>
</where>
</select>
</select>
...
@@ -176,13 +151,13 @@
...
@@ -176,13 +151,13 @@
account_id = #{accountId},
account_id = #{accountId},
</if>
</if>
</set>
</set>
where = #{id}
where
id
= #{id}
</update>
</update>
<!--通过主键删除-->
<!--通过主键删除-->
<update
id=
"deleteById"
parameterType=
"java.lang.Integer"
>
<update
id=
"deleteById"
parameterType=
"java.lang.Integer"
>
update service
update service
set is_deleted = 1
set is_deleted = 1
where = #{id}
where
id
= #{id}
</update>
</update>
</mapper>
</mapper>
\ No newline at end of file
src/main/resources/not-check.yml
浏览文件 @
a3df433c
...
@@ -6,4 +6,4 @@ data-filter:
...
@@ -6,4 +6,4 @@ data-filter:
-
/pms/doc.html
-
/pms/doc.html
-
/pms/swagger-resources/**
-
/pms/swagger-resources/**
-
/pms/webjars/**
-
/pms/webjars/**
-
/pms/product/spec/feignGet
UnitPriceByTag
-
/pms/product/spec/feignGet
SpecLeaseUnitPrice
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论