Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
qianhe-ydsj
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jiangyun
qianhe-ydsj
Commits
d1d7292b
Commit
d1d7292b
authored
Sep 19, 2024
by
jiang'yun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改问题
parent
b781e62f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
880 additions
and
4 deletions
+880
-4
qianhe-admin/src/main/java/com/qianhe/web/controller/common/CommonController.java
+3
-2
qianhe-ydsj/src/main/java/com/qianhe/controller/BzscSczhzxscZbController.java
+121
-0
qianhe-ydsj/src/main/java/com/qianhe/controller/WdWdxxRdController.java
+1
-1
qianhe-ydsj/src/main/java/com/qianhe/domain/BzscSczhzxscCb.java
+81
-0
qianhe-ydsj/src/main/java/com/qianhe/domain/BzscSczhzxscZb.java
+57
-0
qianhe-ydsj/src/main/java/com/qianhe/mapper/BzscSczhzxscZbMapper.java
+94
-0
qianhe-ydsj/src/main/java/com/qianhe/service/IBzscSczhzxscZbService.java
+61
-0
qianhe-ydsj/src/main/java/com/qianhe/service/impl/BzscCyglqglscZbServiceImpl.java
+9
-0
qianhe-ydsj/src/main/java/com/qianhe/service/impl/BzscSczhzxscZbServiceImpl.java
+243
-0
qianhe-ydsj/src/main/java/com/qianhe/service/impl/BzscZczscZbServiceImpl.java
+8
-1
qianhe-ydsj/src/main/resources/mapper/BzscSczhzxscZbMapper.xml
+202
-0
No files found.
qianhe-admin/src/main/java/com/qianhe/web/controller/common/CommonController.java
View file @
d1d7292b
...
...
@@ -147,7 +147,8 @@ public class CommonController
@RequestParam
(
"nd"
)
String
nd
,
@RequestParam
(
"mkmc"
)
String
mkmc
,
@RequestParam
(
"fjlx"
)
String
fjlx
,
@RequestParam
(
"rdpx"
)
String
rdpx
)
throws
Exception
@RequestParam
(
"rdpx"
)
String
rdpx
,
@RequestParam
(
"yl1"
)
String
yl1
)
throws
Exception
{
try
{
...
...
@@ -159,7 +160,7 @@ public class CommonController
// }
// String param="?deptId="+wdWdxxRd.getDeptId()+"&nd="+wdWdxxRd.getNd()+"&mkmc="+wdWdxxRd.getMkmc()+"&fjlx="+wdWdxxRd.getFjlx()+"&rdpx="+wdWdxxRd.getRdpx();
String
param
=
"?deptId="
+
deptId
+
"&nd="
+
nd
+
"&mkmc="
+
mkmc
+
"&fjlx="
+
fjlx
+
"&rdpx="
+
rdpx
;
String
param
=
"?deptId="
+
deptId
+
"&nd="
+
nd
+
"&mkmc="
+
mkmc
+
"&fjlx="
+
fjlx
+
"&rdpx="
+
rdpx
+
"&yl1="
+
yl1
;
for
(
MultipartFile
file
:
files
)
{
// fileName:"/profile/upload/2024/09/14/1_20240914100039A002.jpg"
...
...
qianhe-ydsj/src/main/java/com/qianhe/controller/BzscSczhzxscZbController.java
0 → 100644
View file @
d1d7292b
package
com
.
qianhe
.
controller
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletResponse
;
import
com.qianhe.domain.BzscCyglqglscCb
;
import
com.qianhe.domain.BzscSczhzxscCb
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.qianhe.common.annotation.Log
;
import
com.qianhe.common.core.controller.BaseController
;
import
com.qianhe.common.core.domain.AjaxResult
;
import
com.qianhe.common.enums.BusinessType
;
import
com.qianhe.domain.BzscSczhzxscZb
;
import
com.qianhe.service.IBzscSczhzxscZbService
;
import
com.qianhe.common.utils.poi.ExcelUtil
;
import
com.qianhe.common.core.page.TableDataInfo
;
/**
* 标准手册-生产指挥中心管理手册-主Controller
*
* @author qianhe
* @date 2024-09-19
*/
@RestController
@RequestMapping
(
"/system/bzscSczhzxscZb"
)
public
class
BzscSczhzxscZbController
extends
BaseController
{
@Autowired
private
IBzscSczhzxscZbService
bzscSczhzxscZbService
;
/**
* 查询标准手册-生产指挥中心管理手册-主列表
*/
@PreAuthorize
(
"@ss.hasPermi('system:bzscSczhzxscZb:list')"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
BzscSczhzxscZb
bzscSczhzxscZb
)
{
startPage
();
List
<
BzscSczhzxscZb
>
list
=
bzscSczhzxscZbService
.
selectBzscSczhzxscZbList
(
bzscSczhzxscZb
);
return
getDataTable
(
list
);
}
/**
* 导出标准手册-生产指挥中心管理手册-主列表
*/
@PreAuthorize
(
"@ss.hasPermi('system:bzscSczhzxscZb:export')"
)
@Log
(
title
=
"标准手册-生产指挥中心管理手册-主"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
BzscSczhzxscZb
bzscSczhzxscZb
)
{
List
<
BzscSczhzxscZb
>
list
=
bzscSczhzxscZbService
.
selectBzscSczhzxscZbList
(
bzscSczhzxscZb
);
ExcelUtil
<
BzscSczhzxscZb
>
util
=
new
ExcelUtil
<
BzscSczhzxscZb
>(
BzscSczhzxscZb
.
class
);
util
.
exportExcel
(
response
,
list
,
"标准手册-生产指挥中心管理手册-主数据"
);
}
/**
* 获取标准手册-生产指挥中心管理手册-主详细信息
*/
@PreAuthorize
(
"@ss.hasPermi('system:bzscSczhzxscZb:query')"
)
@GetMapping
(
value
=
"/{ID}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"ID"
)
Long
ID
)
{
BzscSczhzxscZb
bzscSczhzxscZb
=
bzscSczhzxscZbService
.
selectBzscSczhzxscZbByID
(
ID
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
BzscSczhzxscCb
cb
=
bzscSczhzxscZb
.
getBzscSczhzxscCbList
().
size
()
>
0
?
bzscSczhzxscZb
.
getBzscSczhzxscCbList
().
get
(
0
)
:
null
;
map
.
put
(
"nr"
,
cb
!=
null
?
cb
.
getChildList
():
new
ArrayList
<
BzscCyglqglscCb
>());
if
(
cb
!=
null
){
cb
.
setChildList
(
new
ArrayList
<>());
}
map
.
put
(
"bt"
,
cb
);
bzscSczhzxscZb
.
setBzscSczhzxscCbList
(
new
ArrayList
<>());
map
.
put
(
"bzscSczhzxscZb"
,
bzscSczhzxscZb
);
return
success
(
map
);
}
/**
* 新增标准手册-生产指挥中心管理手册-主
*/
@PreAuthorize
(
"@ss.hasPermi('system:bzscSczhzxscZb:add')"
)
@Log
(
title
=
"标准手册-生产指挥中心管理手册-主"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
public
AjaxResult
add
(
@RequestBody
BzscSczhzxscZb
bzscSczhzxscZb
)
{
return
toAjax
(
bzscSczhzxscZbService
.
insertBzscSczhzxscZb
(
bzscSczhzxscZb
));
}
/**
* 修改标准手册-生产指挥中心管理手册-主
*/
@PreAuthorize
(
"@ss.hasPermi('system:bzscSczhzxscZb:edit')"
)
@Log
(
title
=
"标准手册-生产指挥中心管理手册-主"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
public
AjaxResult
edit
(
@RequestBody
BzscSczhzxscZb
bzscSczhzxscZb
)
{
return
toAjax
(
bzscSczhzxscZbService
.
updateBzscSczhzxscZb
(
bzscSczhzxscZb
));
}
/**
* 删除标准手册-生产指挥中心管理手册-主
*/
@PreAuthorize
(
"@ss.hasPermi('system:bzscSczhzxscZb:remove')"
)
@Log
(
title
=
"标准手册-生产指挥中心管理手册-主"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{IDs}"
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
IDs
)
{
return
toAjax
(
bzscSczhzxscZbService
.
deleteBzscSczhzxscZbByIDs
(
IDs
));
}
}
qianhe-ydsj/src/main/java/com/qianhe/controller/WdWdxxRdController.java
View file @
d1d7292b
...
...
@@ -37,7 +37,7 @@ public class WdWdxxRdController extends BaseController
/**
* 查询文档-热点信息列表
*/
@PreAuthorize
(
"@ss.hasPermi('system:wdWdxxRd:list')"
)
//
@PreAuthorize("@ss.hasPermi('system:wdWdxxRd:list')")
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
WdWdxxRd
wdWdxxRd
)
{
...
...
qianhe-ydsj/src/main/java/com/qianhe/domain/BzscSczhzxscCb.java
0 → 100644
View file @
d1d7292b
package
com
.
qianhe
.
domain
;
import
lombok.Data
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
com.qianhe.common.annotation.Excel
;
import
com.qianhe.common.core.domain.BaseEntity
;
import
java.util.List
;
/**
* 标准手册-生产指挥中心管理手册-从对象 bzsc_sczhzxsc_cb
*
* @author qianhe
* @date 2024-09-19
*/
@Data
public
class
BzscSczhzxscCb
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/** 主键 */
private
Long
ID
;
/** 主表id */
@Excel
(
name
=
"主表id"
)
private
Long
zbId
;
/** 单位id */
@Excel
(
name
=
"单位id"
)
private
Long
deptId
;
/** 年度 */
@Excel
(
name
=
"年度"
)
private
String
nd
;
/** 上级id */
@Excel
(
name
=
"上级id"
)
private
Long
parentId
;
/** 名称 */
@Excel
(
name
=
"名称"
)
private
String
mc
;
/** 描述 */
@Excel
(
name
=
"描述"
)
private
String
ms
;
/** 内容 */
@Excel
(
name
=
"内容"
)
private
String
nr
;
/** 排序 */
@Excel
(
name
=
"排序"
)
private
Long
px
;
/** 预留1 */
@Excel
(
name
=
"预留1"
)
private
String
yl1
;
/** 预留2 */
@Excel
(
name
=
"预留2"
)
private
String
yl2
;
/** 预留3 */
@Excel
(
name
=
"预留3"
)
private
String
yl3
;
/** 预留4 */
@Excel
(
name
=
"预留4"
)
private
String
yl4
;
/** 预留5 */
@Excel
(
name
=
"预留5"
)
private
String
yl5
;
private
List
<
BzscSczhzxscCb
>
childList
;
}
qianhe-ydsj/src/main/java/com/qianhe/domain/BzscSczhzxscZb.java
0 → 100644
View file @
d1d7292b
package
com
.
qianhe
.
domain
;
import
java.util.List
;
import
lombok.Data
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
com.qianhe.common.annotation.Excel
;
import
com.qianhe.common.core.domain.BaseEntity
;
/**
* 标准手册-生产指挥中心管理手册-主对象 bzsc_sczhzxsc_zb
*
* @author qianhe
* @date 2024-09-19
*/
@Data
public
class
BzscSczhzxscZb
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/** 主键 */
private
Long
ID
;
/** 单位id */
@Excel
(
name
=
"单位id"
)
private
Long
deptId
;
/** 年度 */
@Excel
(
name
=
"年度"
)
private
String
nd
;
/** 预留1 */
@Excel
(
name
=
"预留1"
)
private
String
yl1
;
/** 预留2 */
@Excel
(
name
=
"预留2"
)
private
String
yl2
;
/** 预留3 */
@Excel
(
name
=
"预留3"
)
private
String
yl3
;
/** 预留4 */
@Excel
(
name
=
"预留4"
)
private
String
yl4
;
/** 预留5 */
@Excel
(
name
=
"预留5"
)
private
String
yl5
;
private
String
deptName
;
/** 标准手册-生产指挥中心管理手册-从信息 */
private
List
<
BzscSczhzxscCb
>
bzscSczhzxscCbList
;
}
qianhe-ydsj/src/main/java/com/qianhe/mapper/BzscSczhzxscZbMapper.java
0 → 100644
View file @
d1d7292b
package
com
.
qianhe
.
mapper
;
import
java.util.List
;
import
com.qianhe.domain.BzscSczhzxscZb
;
import
com.qianhe.domain.BzscSczhzxscCb
;
/**
* 标准手册-生产指挥中心管理手册-主Mapper接口
*
* @author qianhe
* @date 2024-09-19
*/
public
interface
BzscSczhzxscZbMapper
{
/**
* 查询标准手册-生产指挥中心管理手册-主
*
* @param ID 标准手册-生产指挥中心管理手册-主主键
* @return 标准手册-生产指挥中心管理手册-主
*/
public
BzscSczhzxscZb
selectBzscSczhzxscZbByID
(
Long
ID
);
/**
* 查询标准手册-生产指挥中心管理手册-主列表
*
* @param bzscSczhzxscZb 标准手册-生产指挥中心管理手册-主
* @return 标准手册-生产指挥中心管理手册-主集合
*/
public
List
<
BzscSczhzxscZb
>
selectBzscSczhzxscZbList
(
BzscSczhzxscZb
bzscSczhzxscZb
);
/**
* 新增标准手册-生产指挥中心管理手册-主
*
* @param bzscSczhzxscZb 标准手册-生产指挥中心管理手册-主
* @return 结果
*/
public
int
insertBzscSczhzxscZb
(
BzscSczhzxscZb
bzscSczhzxscZb
);
/**
* 修改标准手册-生产指挥中心管理手册-主
*
* @param bzscSczhzxscZb 标准手册-生产指挥中心管理手册-主
* @return 结果
*/
public
int
updateBzscSczhzxscZb
(
BzscSczhzxscZb
bzscSczhzxscZb
);
/**
* 删除标准手册-生产指挥中心管理手册-主
*
* @param ID 标准手册-生产指挥中心管理手册-主主键
* @return 结果
*/
public
int
deleteBzscSczhzxscZbByID
(
Long
ID
);
/**
* 批量删除标准手册-生产指挥中心管理手册-主
*
* @param IDs 需要删除的数据主键集合
* @return 结果
*/
public
int
deleteBzscSczhzxscZbByIDs
(
Long
[]
IDs
);
/**
* 批量删除标准手册-生产指挥中心管理手册-从
*
* @param IDs 需要删除的数据主键集合
* @return 结果
*/
public
int
deleteBzscSczhzxscCbByZbIds
(
Long
[]
IDs
);
/**
* 批量新增标准手册-生产指挥中心管理手册-从
*
* @param bzscSczhzxscCbList 标准手册-生产指挥中心管理手册-从列表
* @return 结果
*/
public
int
batchBzscSczhzxscCb
(
List
<
BzscSczhzxscCb
>
bzscSczhzxscCbList
);
/**
* 通过标准手册-生产指挥中心管理手册-主主键删除标准手册-生产指挥中心管理手册-从信息
*
* @param ID 标准手册-生产指挥中心管理手册-主ID
* @return 结果
*/
public
int
deleteBzscSczhzxscCbByZbId
(
Long
ID
);
List
<
BzscSczhzxscCb
>
selectBzscSczhzxscCbByID
(
Long
ID
);
int
insertBzscSczhzxscCb
(
BzscSczhzxscCb
bzscSczhzxscCb
);
}
qianhe-ydsj/src/main/java/com/qianhe/service/IBzscSczhzxscZbService.java
0 → 100644
View file @
d1d7292b
package
com
.
qianhe
.
service
;
import
java.util.List
;
import
com.qianhe.domain.BzscSczhzxscZb
;
/**
* 标准手册-生产指挥中心管理手册-主Service接口
*
* @author qianhe
* @date 2024-09-19
*/
public
interface
IBzscSczhzxscZbService
{
/**
* 查询标准手册-生产指挥中心管理手册-主
*
* @param ID 标准手册-生产指挥中心管理手册-主主键
* @return 标准手册-生产指挥中心管理手册-主
*/
public
BzscSczhzxscZb
selectBzscSczhzxscZbByID
(
Long
ID
);
/**
* 查询标准手册-生产指挥中心管理手册-主列表
*
* @param bzscSczhzxscZb 标准手册-生产指挥中心管理手册-主
* @return 标准手册-生产指挥中心管理手册-主集合
*/
public
List
<
BzscSczhzxscZb
>
selectBzscSczhzxscZbList
(
BzscSczhzxscZb
bzscSczhzxscZb
);
/**
* 新增标准手册-生产指挥中心管理手册-主
*
* @param bzscSczhzxscZb 标准手册-生产指挥中心管理手册-主
* @return 结果
*/
public
int
insertBzscSczhzxscZb
(
BzscSczhzxscZb
bzscSczhzxscZb
);
/**
* 修改标准手册-生产指挥中心管理手册-主
*
* @param bzscSczhzxscZb 标准手册-生产指挥中心管理手册-主
* @return 结果
*/
public
int
updateBzscSczhzxscZb
(
BzscSczhzxscZb
bzscSczhzxscZb
);
/**
* 批量删除标准手册-生产指挥中心管理手册-主
*
* @param IDs 需要删除的标准手册-生产指挥中心管理手册-主主键集合
* @return 结果
*/
public
int
deleteBzscSczhzxscZbByIDs
(
Long
[]
IDs
);
/**
* 删除标准手册-生产指挥中心管理手册-主信息
*
* @param ID 标准手册-生产指挥中心管理手册-主主键
* @return 结果
*/
public
int
deleteBzscSczhzxscZbByID
(
Long
ID
);
}
qianhe-ydsj/src/main/java/com/qianhe/service/impl/BzscCyglqglscZbServiceImpl.java
View file @
d1d7292b
...
...
@@ -47,6 +47,7 @@ public class BzscCyglqglscZbServiceImpl implements IBzscCyglqglscZbService
//查询从表
List
<
BzscCyglqglscCb
>
cbList
=
bzscCyglqglscZbMapper
.
selectBzscCyglqglscCbByZbId
(
ID
);
bzscCyglqglscZb
.
setBzscCyglqglscCbList
(
buildDeptTree
(
cbList
));
return
bzscCyglqglscZb
;
}
...
...
@@ -142,16 +143,22 @@ public class BzscCyglqglscZbServiceImpl implements IBzscCyglqglscZbService
{
bzscCyglqglscCb
.
setZbId
(
ID
);
bzscCyglqglscCb
.
setParentId
(
0L
);
bzscCyglqglscCb
.
setDeptId
(
bzscCyglqglscZb
.
getDeptId
());
bzscCyglqglscCb
.
setNd
(
bzscCyglqglscZb
.
getNd
());
bzscCyglqglscZbMapper
.
insertBzscCyglqglscCb
(
bzscCyglqglscCb
);
if
(
StringUtils
.
isNotNull
(
bzscCyglqglscCb
.
getChildList
())){
for
(
BzscCyglqglscCb
cb1:
bzscCyglqglscCb
.
getChildList
()){
cb1
.
setZbId
(
ID
);
cb1
.
setParentId
(
bzscCyglqglscCb
.
getID
());
cb1
.
setDeptId
(
bzscCyglqglscZb
.
getDeptId
());
cb1
.
setNd
(
bzscCyglqglscZb
.
getNd
());
bzscCyglqglscZbMapper
.
insertBzscCyglqglscCb
(
cb1
);
if
(
cb1
.
getChildList
().
size
()>
0
){
for
(
BzscCyglqglscCb
cb2:
cb1
.
getChildList
()){
cb2
.
setZbId
(
ID
);
cb2
.
setParentId
(
cb1
.
getID
());
cb2
.
setDeptId
(
bzscCyglqglscZb
.
getDeptId
());
cb2
.
setNd
(
bzscCyglqglscZb
.
getNd
());
bzscCyglqglscZbMapper
.
insertBzscCyglqglscCb
(
cb2
);
}
}
else
{
...
...
@@ -160,6 +167,8 @@ public class BzscCyglqglscZbServiceImpl implements IBzscCyglqglscZbService
BeanUtils
.
copyProperties
(
cb1
,
cb2
);
cb2
.
setZbId
(
ID
);
cb2
.
setParentId
(
cb1
.
getID
());
cb2
.
setDeptId
(
bzscCyglqglscZb
.
getDeptId
());
cb2
.
setNd
(
bzscCyglqglscZb
.
getNd
());
bzscCyglqglscZbMapper
.
insertBzscCyglqglscCb
(
cb2
);
}
}
...
...
qianhe-ydsj/src/main/java/com/qianhe/service/impl/BzscSczhzxscZbServiceImpl.java
0 → 100644
View file @
d1d7292b
package
com
.
qianhe
.
service
.
impl
;
import
java.util.Iterator
;
import
java.util.List
;
import
com.qianhe.common.annotation.DataScope
;
import
com.qianhe.common.utils.DateUtils
;
import
com.qianhe.common.utils.bean.BeanUtils
;
import
com.qianhe.domain.BzscCyglqglscCb
;
import
lombok.Data
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.stream.Collectors
;
import
com.qianhe.common.utils.StringUtils
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.qianhe.domain.BzscSczhzxscCb
;
import
com.qianhe.mapper.BzscSczhzxscZbMapper
;
import
com.qianhe.domain.BzscSczhzxscZb
;
import
com.qianhe.service.IBzscSczhzxscZbService
;
/**
* 标准手册-生产指挥中心管理手册-主Service业务层处理
*
* @author qianhe
* @date 2024-09-19
*/
@Service
public
class
BzscSczhzxscZbServiceImpl
implements
IBzscSczhzxscZbService
{
@Autowired
private
BzscSczhzxscZbMapper
bzscSczhzxscZbMapper
;
/**
* 查询标准手册-生产指挥中心管理手册-主
*
* @param ID 标准手册-生产指挥中心管理手册-主主键
* @return 标准手册-生产指挥中心管理手册-主
*/
@Override
public
BzscSczhzxscZb
selectBzscSczhzxscZbByID
(
Long
ID
)
{
BzscSczhzxscZb
bzscSczhzxscZb
=
bzscSczhzxscZbMapper
.
selectBzscSczhzxscZbByID
(
ID
);
List
<
BzscSczhzxscCb
>
cbList
=
bzscSczhzxscZbMapper
.
selectBzscSczhzxscCbByID
(
ID
);
bzscSczhzxscZb
.
setBzscSczhzxscCbList
(
buildDeptTree
(
cbList
));
return
bzscSczhzxscZb
;
}
/**
* 查询标准手册-生产指挥中心管理手册-主列表
*
* @param bzscSczhzxscZb 标准手册-生产指挥中心管理手册-主
* @return 标准手册-生产指挥中心管理手册-主
*/
@Override
@DataScope
(
deptAlias
=
"d"
)
public
List
<
BzscSczhzxscZb
>
selectBzscSczhzxscZbList
(
BzscSczhzxscZb
bzscSczhzxscZb
)
{
return
bzscSczhzxscZbMapper
.
selectBzscSczhzxscZbList
(
bzscSczhzxscZb
);
}
/**
* 新增标准手册-生产指挥中心管理手册-主
*
* @param bzscSczhzxscZb 标准手册-生产指挥中心管理手册-主
* @return 结果
*/
@Transactional
@Override
public
int
insertBzscSczhzxscZb
(
BzscSczhzxscZb
bzscSczhzxscZb
)
{
bzscSczhzxscZb
.
setCreateTime
(
DateUtils
.
getNowDate
());
int
rows
=
bzscSczhzxscZbMapper
.
insertBzscSczhzxscZb
(
bzscSczhzxscZb
);
insertBzscSczhzxscCb
(
bzscSczhzxscZb
);
return
rows
;
}
/**
* 修改标准手册-生产指挥中心管理手册-主
*
* @param bzscSczhzxscZb 标准手册-生产指挥中心管理手册-主
* @return 结果
*/
@Transactional
@Override
public
int
updateBzscSczhzxscZb
(
BzscSczhzxscZb
bzscSczhzxscZb
)
{
bzscSczhzxscZb
.
setUpdateTime
(
DateUtils
.
getNowDate
());
bzscSczhzxscZbMapper
.
deleteBzscSczhzxscCbByZbId
(
bzscSczhzxscZb
.
getID
());
insertBzscSczhzxscCb
(
bzscSczhzxscZb
);
return
bzscSczhzxscZbMapper
.
updateBzscSczhzxscZb
(
bzscSczhzxscZb
);
}
/**
* 批量删除标准手册-生产指挥中心管理手册-主
*
* @param IDs 需要删除的标准手册-生产指挥中心管理手册-主主键
* @return 结果
*/
@Transactional
@Override
public
int
deleteBzscSczhzxscZbByIDs
(
Long
[]
IDs
)
{
bzscSczhzxscZbMapper
.
deleteBzscSczhzxscCbByZbIds
(
IDs
);
return
bzscSczhzxscZbMapper
.
deleteBzscSczhzxscZbByIDs
(
IDs
);
}
/**
* 删除标准手册-生产指挥中心管理手册-主信息
*
* @param ID 标准手册-生产指挥中心管理手册-主主键
* @return 结果
*/
@Transactional
@Override
public
int
deleteBzscSczhzxscZbByID
(
Long
ID
)
{
bzscSczhzxscZbMapper
.
deleteBzscSczhzxscCbByZbId
(
ID
);
return
bzscSczhzxscZbMapper
.
deleteBzscSczhzxscZbByID
(
ID
);
}
/**
* 新增标准手册-生产指挥中心管理手册-从信息
*
* @param bzscSczhzxscZb 标准手册-生产指挥中心管理手册-主对象
*/
public
void
insertBzscSczhzxscCb
(
BzscSczhzxscZb
bzscSczhzxscZb
)
{
List
<
BzscSczhzxscCb
>
bzscSczhzxscCbList
=
bzscSczhzxscZb
.
getBzscSczhzxscCbList
();
Long
ID
=
bzscSczhzxscZb
.
getID
();
if
(
StringUtils
.
isNotNull
(
bzscSczhzxscCbList
))
{
// List<BzscSczhzxscCb> list = new ArrayList<BzscSczhzxscCb>();
for
(
BzscSczhzxscCb
bzscSczhzxscCb
:
bzscSczhzxscCbList
)
{
bzscSczhzxscCb
.
setZbId
(
ID
);
bzscSczhzxscCb
.
setParentId
(
0L
);
bzscSczhzxscCb
.
setDeptId
(
bzscSczhzxscZb
.
getDeptId
());
bzscSczhzxscCb
.
setNd
(
bzscSczhzxscZb
.
getNd
());
bzscSczhzxscZbMapper
.
insertBzscSczhzxscCb
(
bzscSczhzxscCb
);
if
(
StringUtils
.
isNotNull
(
bzscSczhzxscCb
.
getChildList
())){
for
(
BzscSczhzxscCb
cb1:
bzscSczhzxscCb
.
getChildList
()){
cb1
.
setZbId
(
ID
);
cb1
.
setParentId
(
bzscSczhzxscZb
.
getID
());
cb1
.
setDeptId
(
bzscSczhzxscZb
.
getDeptId
());
cb1
.
setNd
(
bzscSczhzxscZb
.
getNd
());
bzscSczhzxscZbMapper
.
insertBzscSczhzxscCb
(
cb1
);
if
(
cb1
.
getChildList
().
size
()>
0
){
for
(
BzscSczhzxscCb
cb2:
cb1
.
getChildList
()){
cb2
.
setZbId
(
ID
);
cb2
.
setParentId
(
cb1
.
getID
());
cb2
.
setDeptId
(
bzscSczhzxscZb
.
getDeptId
());
cb2
.
setNd
(
bzscSczhzxscZb
.
getNd
());
bzscSczhzxscZbMapper
.
insertBzscSczhzxscCb
(
cb2
);
}
}
else
{
//一级分类没有子级 则本身添加一条子级
BzscSczhzxscCb
cb2
=
new
BzscSczhzxscCb
();
BeanUtils
.
copyProperties
(
cb1
,
cb2
);
cb2
.
setZbId
(
ID
);
cb2
.
setParentId
(
cb1
.
getID
());
cb2
.
setDeptId
(
bzscSczhzxscZb
.
getDeptId
());
cb2
.
setNd
(
bzscSczhzxscZb
.
getNd
());
bzscSczhzxscZbMapper
.
insertBzscSczhzxscCb
(
cb2
);
}
}
}
// list.add(bzscSczhzxscCb);
}
// if (list.size() > 0)
// {
// bzscSczhzxscZbMapper.batchBzscSczhzxscCb(list);
// }
}
}
public
List
<
BzscSczhzxscCb
>
buildDeptTree
(
List
<
BzscSczhzxscCb
>
cbList
)
{
List
<
BzscSczhzxscCb
>
returnList
=
new
ArrayList
<
BzscSczhzxscCb
>();
List
<
Long
>
tempList
=
cbList
.
stream
().
map
(
BzscSczhzxscCb:
:
getID
).
collect
(
Collectors
.
toList
());
for
(
BzscSczhzxscCb
cb
:
cbList
)
{
// 如果是顶级节点, 遍历该父节点的所有子节点
if
(!
tempList
.
contains
(
cb
.
getParentId
()))
{
recursionFn
(
cbList
,
cb
);
returnList
.
add
(
cb
);
}
}
if
(
returnList
.
isEmpty
())
{
returnList
=
cbList
;
}
return
returnList
;
}
/**
* 递归列表
*/
private
void
recursionFn
(
List
<
BzscSczhzxscCb
>
list
,
BzscSczhzxscCb
t
)
{
// 得到子节点列表
List
<
BzscSczhzxscCb
>
childList
=
getChildList
(
list
,
t
);
t
.
setChildList
(
childList
);
for
(
BzscSczhzxscCb
tChild
:
childList
)
{
if
(
hasChild
(
list
,
tChild
))
{
recursionFn
(
list
,
tChild
);
}
}
}
/**
* 得到子节点列表
*/
private
List
<
BzscSczhzxscCb
>
getChildList
(
List
<
BzscSczhzxscCb
>
list
,
BzscSczhzxscCb
t
)
{
List
<
BzscSczhzxscCb
>
tlist
=
new
ArrayList
<
BzscSczhzxscCb
>();
Iterator
<
BzscSczhzxscCb
>
it
=
list
.
iterator
();
while
(
it
.
hasNext
())
{
BzscSczhzxscCb
n
=
(
BzscSczhzxscCb
)
it
.
next
();
if
(
StringUtils
.
isNotNull
(
n
.
getParentId
())
&&
n
.
getParentId
().
longValue
()
==
t
.
getID
().
longValue
())
{
tlist
.
add
(
n
);
}
}
return
tlist
;
}
/**
* 判断是否有子节点
*/
private
boolean
hasChild
(
List
<
BzscSczhzxscCb
>
list
,
BzscSczhzxscCb
t
)
{
return
getChildList
(
list
,
t
).
size
()
>
0
;
}
}
qianhe-ydsj/src/main/java/com/qianhe/service/impl/BzscZczscZbServiceImpl.java
View file @
d1d7292b
...
...
@@ -139,18 +139,23 @@ public class BzscZczscZbServiceImpl implements IBzscZczscZbService
for
(
BzscZczscCb
bzscZczscCb
:
bzscZczscCbList
)
{
bzscZczscCb
.
setZbId
(
ID
);
bzscZczscCb
.
setZbId
(
ID
);
bzscZczscCb
.
setParentId
(
0L
);
bzscZczscCb
.
setDeptId
(
bzscZczscZb
.
getDeptId
());
bzscZczscCb
.
setNd
(
bzscZczscZb
.
getNd
());
bzscZczscZbMapper
.
insertBzscZczscCb
(
bzscZczscCb
);
if
(
StringUtils
.
isNotNull
(
bzscZczscCb
.
getChildList
())){
for
(
BzscZczscCb
cb1:
bzscZczscCb
.
getChildList
()){
cb1
.
setZbId
(
ID
);
cb1
.
setParentId
(
bzscZczscCb
.
getID
());
cb1
.
setDeptId
(
bzscZczscZb
.
getDeptId
());
cb1
.
setNd
(
bzscZczscZb
.
getNd
());
bzscZczscZbMapper
.
insertBzscZczscCb
(
cb1
);
if
(
cb1
.
getChildList
().
size
()>
0
){
for
(
BzscZczscCb
cb2:
cb1
.
getChildList
()){
cb2
.
setZbId
(
ID
);
cb2
.
setParentId
(
cb1
.
getID
());
cb2
.
setDeptId
(
bzscZczscZb
.
getDeptId
());
cb2
.
setNd
(
bzscZczscZb
.
getNd
());
bzscZczscZbMapper
.
insertBzscZczscCb
(
cb2
);
}
}
else
{
...
...
@@ -159,6 +164,8 @@ public class BzscZczscZbServiceImpl implements IBzscZczscZbService
BeanUtils
.
copyProperties
(
cb1
,
cb2
);
cb2
.
setZbId
(
ID
);
cb2
.
setParentId
(
cb1
.
getID
());
cb2
.
setDeptId
(
bzscZczscZb
.
getDeptId
());
cb2
.
setNd
(
bzscZczscZb
.
getNd
());
bzscZczscZbMapper
.
insertBzscZczscCb
(
cb2
);
}
}
...
...
qianhe-ydsj/src/main/resources/mapper/BzscSczhzxscZbMapper.xml
0 → 100644
View file @
d1d7292b
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment