Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pms
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
pms
Commits
eb53ada3
提交
eb53ada3
authored
6月 08, 2023
作者:
panda
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
服务管理相关接口
上级
f895b02a
隐藏空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
407 行增加
和
63 行删除
+407
-63
BackstageCategoriesController.java
...com/mmc/pms/controller/BackstageCategoriesController.java
+4
-0
BackstageTaskServiceController.java
...om/mmc/pms/controller/BackstageTaskServiceController.java
+5
-3
DirectoryController.java
...main/java/com/mmc/pms/controller/DirectoryController.java
+61
-0
BackstageTaskServiceDao.java
src/main/java/com/mmc/pms/dao/BackstageTaskServiceDao.java
+5
-3
CategoriesDao.java
src/main/java/com/mmc/pms/dao/CategoriesDao.java
+11
-5
DirectoryDao.java
src/main/java/com/mmc/pms/dao/DirectoryDao.java
+18
-0
DirectoryDO.java
src/main/java/com/mmc/pms/entity/DirectoryDO.java
+2
-2
CategoriesDTO.java
.../java/com/mmc/pms/model/categories/dto/CategoriesDTO.java
+34
-0
ServiceQO.java
src/main/java/com/mmc/pms/model/qo/ServiceQO.java
+6
-0
ServiceDTO.java
src/main/java/com/mmc/pms/model/work/dto/ServiceDTO.java
+113
-0
BackstageTaskService.java
src/main/java/com/mmc/pms/service/BackstageTaskService.java
+2
-1
CategoriesService.java
src/main/java/com/mmc/pms/service/CategoriesService.java
+14
-0
BackstageTaskServiceImpl.java
...va/com/mmc/pms/service/Impl/BackstageTaskServiceImpl.java
+54
-4
CategoriesServiceImpl.java
.../java/com/mmc/pms/service/Impl/CategoriesServiceImpl.java
+38
-10
CategoriesDao.xml
src/main/resources/mapper/CategoriesDao.xml
+16
-2
DirectoryDao.xml
src/main/resources/mapper/DirectoryDao.xml
+15
-0
BackstageTaskServiceDao.xml
src/main/resources/mapper/work/BackstageTaskServiceDao.xml
+9
-33
没有找到文件。
src/main/java/com/mmc/pms/controller/BackstageCategoriesController.java
浏览文件 @
eb53ada3
package
com
.
mmc
.
pms
.
controller
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.entity.Categories
;
import
com.mmc.pms.model.categories.dto.ClassifyDetailsDTO
;
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.DirectoryInfoVO
;
import
com.mmc.pms.model.categories.vo.RelevantBusinessVO
;
...
...
@@ -14,8 +16,10 @@ import io.swagger.annotations.*;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.validation.constraints.Min
;
import
java.util.List
;
/**
* @Author lw @Date 2023/5/15 13:24 @Version 1.0
...
...
src/main/java/com/mmc/pms/controller/BackstageTaskServiceController.java
浏览文件 @
eb53ada3
...
...
@@ -5,7 +5,9 @@ import com.mmc.pms.common.ResultBody;
import
com.mmc.pms.model.group.Create
;
import
com.mmc.pms.model.group.Update
;
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.page.PageResult
;
import
com.mmc.pms.service.BackstageTaskService
;
import
io.swagger.annotations.*
;
import
org.springframework.validation.annotation.Validated
;
...
...
@@ -48,16 +50,16 @@ public class BackstageTaskServiceController extends BaseController {
}
@ApiOperation
(
value
=
"查询作业服务"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ServiceDTO
.
class
)})
@GetMapping
(
"queryWorkService"
)
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
)})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ServiceDTO
.
class
)})
@PostMapping
(
"queryWorkServiceList"
)
public
ResultBody
queryWorkServiceList
(
@Validated
(
Create
.
class
)
@RequestBody
ServiceQO
param
,
HttpServletRequest
request
)
{
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/DirectoryController.java
0 → 100644
浏览文件 @
eb53ada3
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/dao/BackstageTaskServiceDao.java
浏览文件 @
eb53ada3
...
...
@@ -13,13 +13,15 @@ import java.util.List;
*/
@Mapper
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
);
List
<
ServiceDO
>
queryAllByLimit
(
ServiceQO
param
);
Integer
count
(
ServiceQO
param
);
}
src/main/java/com/mmc/pms/dao/CategoriesDao.java
浏览文件 @
eb53ada3
package
com
.
mmc
.
pms
.
dao
;
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.DirectoryInfoVO
;
import
com.mmc.pms.model.sale.vo.QueryClassifyVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Set
;
/**
* @author 23214
...
...
@@ -20,13 +22,13 @@ public interface CategoriesDao {
int
countUpdateDirectoryName
(
DirectoryInfoVO
param
);
void
insertDirectory
(
Directory
directory
);
void
insertDirectory
(
Directory
DO
directory
);
void
updateDirectory
(
Directory
directory
);
void
updateDirectory
(
Directory
DO
directory
);
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
);
...
...
@@ -52,7 +54,11 @@ public interface CategoriesDao {
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
);
}
...
...
src/main/java/com/mmc/pms/dao/DirectoryDao.java
0 → 100644
浏览文件 @
eb53ada3
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/entity/Directory.java
→
src/main/java/com/mmc/pms/entity/Directory
DO
.java
浏览文件 @
eb53ada3
...
...
@@ -17,7 +17,7 @@ import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
Directory
implements
Serializable
{
public
class
Directory
DO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
713939370607409336L
;
/**
* 主键id
...
...
@@ -50,7 +50,7 @@ public class Directory implements Serializable {
private
String
relevanceName
;
public
Directory
(
DirectoryInfoVO
param
)
{
public
Directory
DO
(
DirectoryInfoVO
param
)
{
this
.
id
=
param
.
getId
();
this
.
directoryName
=
param
.
getDirectoryName
();
this
.
pid
=
param
.
getPid
();
...
...
src/main/java/com/mmc/pms/model/categories/dto/CategoriesDTO.java
0 → 100644
浏览文件 @
eb53ada3
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/qo/ServiceQO.java
浏览文件 @
eb53ada3
...
...
@@ -39,6 +39,9 @@ public class ServiceQO implements Serializable {
@ApiModelProperty
(
value
=
"行业"
,
example
=
"2"
)
private
Integer
industryId
;
@ApiModelProperty
(
value
=
"账号id"
)
private
Integer
accountId
;
@ApiModelProperty
(
value
=
"页码"
,
required
=
true
)
@NotNull
(
message
=
"页码不能为空"
,
groups
=
{
Page
.
class
,
Freeze
.
class
})
@Min
(
value
=
1
,
groups
=
Page
.
class
)
...
...
@@ -49,4 +52,7 @@ public class ServiceQO implements Serializable {
@Min
(
value
=
1
,
groups
=
Page
.
class
)
private
Integer
pageSize
;
public
void
buildCurrentPage
()
{
this
.
pageNo
=
(
pageNo
-
1
)
*
pageSize
;
}
}
src/main/java/com/mmc/pms/model/work/dto/ServiceDTO.java
0 → 100644
浏览文件 @
eb53ada3
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/service/BackstageTaskService.java
浏览文件 @
eb53ada3
...
...
@@ -4,6 +4,7 @@ package com.mmc.pms.service;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.model.qo.ServiceQO
;
import
com.mmc.pms.model.work.vo.ServiceVO
;
import
com.mmc.pms.page.PageResult
;
/**
* @Author LW
...
...
@@ -19,5 +20,5 @@ public interface BackstageTaskService {
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
浏览文件 @
eb53ada3
package
com
.
mmc
.
pms
.
service
;
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.DirectoryInfoVO
;
import
com.mmc.pms.model.sale.vo.QueryClassifyVO
;
import
com.mmc.pms.page.PageResult
;
import
java.util.List
;
import
java.util.Set
;
/**
* @author 23214
* @description 针对表【categories(通用分类表)】的数据库操作Service
...
...
@@ -34,4 +41,11 @@ public interface CategoriesService {
ResultBody
deleteRelevantBusiness
(
Integer
id
);
ResultBody
getDirectoryList
(
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
浏览文件 @
eb53ada3
package
com
.
mmc
.
pms
.
service
.
Impl
;
import
com.google.common.collect.Lists
;
import
com.mmc.pms.common.ResultBody
;
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.model.qo.ServiceQO
;
import
com.mmc.pms.model.work.dto.ServiceDTO
;
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.CategoriesService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.util.List
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* @Author LW
...
...
@@ -22,6 +30,9 @@ public class BackstageTaskServiceImpl implements BackstageTaskService {
@Autowired
private
BackstageTaskServiceDao
backstageTaskServiceDao
;
@Autowired
private
CategoriesDao
categoriesDao
;
@Override
public
ResultBody
addWorkService
(
ServiceVO
param
,
Integer
userAccountId
)
{
ServiceDO
serviceDO
=
new
ServiceDO
(
param
,
userAccountId
);
...
...
@@ -45,12 +56,51 @@ public class BackstageTaskServiceImpl implements BackstageTaskService {
@Override
public
ResultBody
queryById
(
Integer
id
)
{
ServiceDO
serviceDO
=
backstageTaskServiceDao
.
queryById
(
id
);
return
ResultBody
.
success
(
serviceDO
);
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
);
}
private
Map
<
Integer
,
String
>
getCategoriesNameByIds
(
List
<
Integer
>
ids
){
if
(
CollectionUtils
.
isEmpty
(
ids
)){
return
new
HashMap
<>();
}
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
public
ResultBody
queryWorkServiceList
(
ServiceQO
param
,
Integer
userAccountId
)
{
public
PageResult
queryWorkServiceList
(
ServiceQO
param
,
Integer
userAccountId
)
{
int
count
=
backstageTaskServiceDao
.
count
(
param
);
if
(
count
==
0
){
return
PageResult
.
buildPage
(
param
.
getPageNo
(),
param
.
getPageSize
(),
count
);
}
Integer
pageNo
=
param
.
getPageNo
();
param
.
buildCurrentPage
();
List
<
ServiceDO
>
services
=
backstageTaskServiceDao
.
queryAllByLimit
(
param
);
return
null
;
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
浏览文件 @
eb53ada3
package
com
.
mmc
.
pms
.
service
.
Impl
;
import
com.google.common.collect.Lists
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.common.ResultEnum
;
import
com.mmc.pms.dao.CategoriesDao
;
import
com.mmc.pms.dao.DirectoryDao
;
import
com.mmc.pms.dao.GoodsInfoDao
;
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.model.categories.dto.CategoriesDTO
;
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.DirectoryInfoVO
;
import
com.mmc.pms.model.categories.vo.RelevantBusinessVO
;
...
...
@@ -21,10 +25,7 @@ import org.springframework.transaction.annotation.Transactional;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -38,6 +39,8 @@ public class CategoriesServiceImpl implements CategoriesService {
private
CategoriesDao
categoriesDao
;
@Resource
private
GoodsInfoDao
goodsInfoDao
;
@Autowired
private
DirectoryDao
directoryDao
;
@Override
public
ResultBody
addOrEditDirectory
(
DirectoryInfoVO
param
)
{
...
...
@@ -45,7 +48,7 @@ public class CategoriesServiceImpl implements CategoriesService {
if
(
type
>
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
DIRECTORY_NAME_HAS_BEEN_EXIST
);
}
Directory
directory
=
new
Directory
(
param
);
Directory
DO
directory
=
new
DirectoryDO
(
param
);
if
(
param
.
getId
()
==
null
)
{
categoriesDao
.
insertDirectory
(
directory
);
}
else
{
...
...
@@ -64,8 +67,8 @@ public class CategoriesServiceImpl implements CategoriesService {
if
(
count
==
0
)
{
return
PageResult
.
buildPage
(
pageNo
,
pageSize
,
count
);
}
List
<
Directory
>
directoryList
=
categoriesDao
.
directoryList
((
pageNo
-
1
)
*
pageSize
,
pageSize
,
type
);
List
<
DirectoryInfoVO
>
list
=
directoryList
.
stream
().
map
(
Directory:
:
buildDirectoryInfoVO
).
collect
(
Collectors
.
toList
());
List
<
Directory
DO
>
directoryList
=
categoriesDao
.
directoryList
((
pageNo
-
1
)
*
pageSize
,
pageSize
,
type
);
List
<
DirectoryInfoVO
>
list
=
directoryList
.
stream
().
map
(
Directory
DO
:
:
buildDirectoryInfoVO
).
collect
(
Collectors
.
toList
());
return
PageResult
.
buildPage
(
pageNo
,
pageSize
,
count
,
list
);
}
...
...
@@ -193,11 +196,36 @@ public class CategoriesServiceImpl implements CategoriesService {
@Override
public
ResultBody
getDirectoryList
(
Integer
type
)
{
List
<
Directory
>
directoryList
=
categoriesDao
.
getDirectoryList
(
type
);
List
<
DirectoryInfoVO
>
list
=
directoryList
.
stream
().
map
(
Directory:
:
buildDirectoryInfoVO
).
collect
(
Collectors
.
toList
());
List
<
Directory
DO
>
directoryList
=
categoriesDao
.
getDirectoryList
(
type
);
List
<
DirectoryInfoVO
>
list
=
directoryList
.
stream
().
map
(
Directory
DO
:
:
buildDirectoryInfoVO
).
collect
(
Collectors
.
toList
());
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
public
ResultBody
deleteRelevantBusiness
(
Integer
id
)
{
...
...
src/main/resources/mapper/CategoriesDao.xml
浏览文件 @
eb53ada3
...
...
@@ -84,7 +84,7 @@
from directory
where is_deleted = 0
</select>
<select
id=
"directoryList"
resultType=
"com.mmc.pms.entity.Directory"
>
<select
id=
"directoryList"
resultType=
"com.mmc.pms.entity.Directory
DO
"
>
SELECT d.id,
d.directory_name,
d.pid,
...
...
@@ -168,7 +168,7 @@
where id = #{id}
and is_default = 0
</select>
<select
id=
"getDirectoryList"
resultType=
"com.mmc.pms.entity.Directory"
>
<select
id=
"getDirectoryList"
resultType=
"com.mmc.pms.entity.Directory
DO
"
>
SELECT d.id,
d.directory_name,
d.pid,
...
...
@@ -181,6 +181,20 @@
AND d.pid IS NULL
ORDER BY create_time DESC
</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 `categories`
SET `is_deleted` = 1
...
...
src/main/resources/mapper/DirectoryDao.xml
0 → 100644
浏览文件 @
eb53ada3
<?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/work/BackstageTaskServiceDao.xml
浏览文件 @
eb53ada3
...
...
@@ -65,7 +65,7 @@
from service
<where>
<if
test=
"serviceName != null and serviceName != ''"
>
and service_name
= #{serviceName}
and service_name
LIKE CONCAT('%',#{serviceName},'%')
</if>
<if
test=
"applicationId != null"
>
and application_id = #{applicationId}
...
...
@@ -84,15 +84,12 @@
</select>
<!--统计总行数-->
<select
id=
"count"
resultType=
"java.lang.Long
"
>
select count(
1
)
<select
id=
"count"
parameterType=
"com.mmc.pms.model.qo.ServiceQO"
resultType=
"java.lang.Integer
"
>
select count(
*
)
from service
<where>
<if
test=
"id != null"
>
and id = #{id}
</if>
<if
test=
"serviceName != null and serviceName != ''"
>
and service_name
= #{serviceName}
and service_name
LIKE CONCAT('%',#{serviceName},'%')
</if>
<if
test=
"applicationId != null"
>
and application_id = #{applicationId}
...
...
@@ -100,33 +97,11 @@
<if
test=
"industryId != null"
>
and industry_id = #{industryId}
</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"
>
and account_id = #{accountId}
</if>
and is_deleted = 0
and display_state = 0
</where>
</select>
...
...
@@ -176,13 +151,13 @@
account_id = #{accountId},
</if>
</set>
where = #{id}
where
id
= #{id}
</update>
<!--通过主键删除-->
<update
id=
"deleteById"
parameterType=
"java.lang.Integer"
>
update service
set is_deleted = 1
where = #{id}
where
id
= #{id}
</update>
</mapper>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论